Add validation script

All the topics other than the two goes here.
  • Ads

Add validation script

Postby xmccay » Fri Dec 04, 2009 6:44 am

Hi,

If I want to add my custom validation script into the existing validation from the join form, how should I go about to do that?

I checked join.php but there is no form tag with action or onsubmit function is called

when I checked on the inc/js/join.js, I don't see any existing validation script that I can edit or add script into it.

Actually what I want to do is add a validation script where is a field on top is filled, other particular field will be a compulsory field. If it is not filled, deactivate the validation. Please advise. and thanks.
xmccay
Jr. Member
Jr. Member
 
Posts: 195
Joined: Sat Nov 01, 2008 3:42 pm

Re: Add validation script

Postby Administrator » Sat Dec 05, 2009 12:41 pm

There is a onSubmit event and it calls "validateJoinForm" function.

You can edit that for your need.
Regards,
Praveen
Administrator
Administrator
Administrator
 
Posts: 1069
Joined: Mon Aug 25, 2008 7:18 am
Location: India

Re: Add validation script

Postby xmccay » Wed Dec 23, 2009 12:54 pm

hi,

I have checked join.js

Code: Select all
function validateJoinForm( eForm ) {
   if( !eForm )
      return false;


Where should I add the extra field validation? I tried to add something like below but it doesn't work.

if(document.join_form.country.value =="India" && document.join_form.city.value =="" )
{
alert ("Please enter city name");
return false;
}
xmccay
Jr. Member
Jr. Member
 
Posts: 195
Joined: Sat Nov 01, 2008 3:42 pm

Re: Add validation script

Postby Administrator » Sat Dec 26, 2009 3:57 pm

Actually it works on a different way.

The javascript will submit the value to the server. The server evaluates and sends the reply to the client. Then the javascript will display the message.
Regards,
Praveen
Administrator
Administrator
Administrator
 
Posts: 1069
Joined: Mon Aug 25, 2008 7:18 am
Location: India

  • Ads

Return to Dolphin General Help

Who is online

Users browsing this forum: No registered users and 1 guest

cron