Hi, I'm trying to create a simple validation check that forces users to click a checkbox(agreeing to ToS) . The problem I am having is that I use a custom submit graphic. I tried simply using the onclick event handler on the custom graphic link but I can only get it to work if I use it on a form submit button. Any help sorry I am still very new to javascript. Thanks
For validation always use the form's onsubmit event: <form ............. onsubmit="return validator(this)"> Code (markup):
I see.. but can I simply take the onSubmit = "return validator(this)"> and stick it like this <a href = "http://www.google.ca" onSubmit = "return validator(this)"> <img src = "imagefile" /></a> HTML: It works fine if I add a regular submit button, but nothing is happening when i use my custom image as the submit.
Hi, mphilips You should use the image type for input tag <input type="image" src="path_to_your_image" onclick="return validator(this);" /> PHP: