It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

Hard Radio Group Validation

Hard Radio Group Validation

Postby spacemoc on Tue Sep 21, 2010 4:50 pm

Dear Users,

I am trying to validate 4 radio groups (YES/NO) and get user to select at least one YES, doesnt matter which one. I am using a Spry Validation from Dreamweaver + the function listed below, but when I use this function the Spry Validation doesnt work, I think so I need to rebuild attached file (please change txt for js)

function validate(f) {
if(!f.RadioGroup1[0].checked && !f.RadioGroup2[0].checked) {
alert('Please select at least one Yes');
return false;
}
return true;
}

I think so this is the place inside the Spry file to make a changes but I am ot quite sure how to make it

// check isRequired
if (this.isRequired && (nochecked == 0 || required != 0))
{
this.addClassName(this.element, this.requiredClass);
this.addClassName(this.additionalError, this.requiredClass);
return false;
}
this.addClassName(this.element, this.validClass);
this.addClassName(this.additionalError, this.validClass);
return true;
};
spacemoc
 
Posts: 1
Joined: Tue Sep 21, 2010 4:48 pm

Who is online

Users browsing this forum: No registered users and 7 guests