Hello. I am trying to use javascript to validate a form, in order to require that my form variants I've set up are filled out, and that a license agreement checkbox is checked before the OnClick of the Add to Cart button is processed.
So there are two functions that the onClick event needs to call. How do I combine functions into the onClick event?
I currently have onClick="return agreed(this);" and want to add onClick="return validate_form ( );" so that it performs both functions. I've tried onClick="return agreed(this);return validate_form ( );" to no luck. Is there a way to combine the onClick functions?
I am using javascript code from http://www.elated.com/articles/form-validation-with-javascript/ to validate the form, and code from http://juxtaprose.com/articles/e-junkie-click-agree.html to validate the agreement checkbox. Both would seem to be called through the onClick event.
Or is there another way to require form variants that I do not know of? Thanks for the help, it is much appreciated!
created
Apr '10
last reply
Apr '10
- 3
replies
- 1.1k
views
- 2
users
- 2
links