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

Have a programming question regarding your component, plug-in, extension or core hacks? Have an interesting tidbit, FAQ or programming tip you’d like to share? This is the place for you.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Post Reply
dee_jay
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Tue Nov 14, 2006 12:20 am

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

Post by dee_jay » Mon Oct 01, 2007 2:00 pm

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.
Last edited by dee_jay on Tue Oct 16, 2007 3:51 pm, edited 1 time in total.

dee_jay
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Tue Nov 14, 2006 12:20 am

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

Post by dee_jay » Tue Oct 02, 2007 11:40 pm

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.

dee_jay
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Tue Nov 14, 2006 12:20 am

Re: Adding Checkbox to Registration Form -- Solved

Post by dee_jay » Wed Oct 03, 2007 11:55 am

I modified the validation code to:

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


It now works fine.


Post Reply