Page 1 of 1

Adding Checkbox to Registration Form -- Almost there !!!

Posted: Mon Oct 01, 2007 2:00 pm
by dee_jay
I'm trying to add a checkbox to the Registration form.

In registration.html.php I added the following:



*






 
 








THIS IS A TEST FOR THE AGREEMENT TERMS

to see if I can add text.









       




In the field validation section I added:

} else if ((form.password.value != "") && (form.password.value != form.password2.value)){
alert( "" );
} else if (r.exec(form.password.value)) {
alert( "" );


}  else if (form.inputbox.IAgree.value == "yes") {
alert( "" );



} else {
form.submit();
}
}


My Fireworks error consule says "form.inputbox has no properties" and highlights this line:

} else if (form.inputbox.IAgree.value = = "yes") {


Can someone help me with this please ... this feature is very important for my site.

Thanks.

Re: Adding Checkbox to Registration Form -- Almost there !!!

Posted: Tue Oct 02, 2007 11:40 pm
by dee_jay
I've made some progress ...

I changed the validation code to:

  }  else if (form.IAgree.value == "yes") {
            alert( "" );


This got rid of the error message I indicated above.

Now, the problem is that when I check the box, I still get the alert "Please check the I AGREE checkbox" and the form will not submit.

Any help greatly appreciated.

Re: Adding Checkbox to Registration Form -- Solved

Posted: Wed Oct 03, 2007 11:55 am
by dee_jay
I modified the validation code to:

  }  else if (form.IAgree.checked == false) {
            alert( "" );


It now works fine.