That could be done using Ajax, but would make the CAPTCHA much easier to break.
The illustration below shows this relationship: Note that the 'I' in selected Index needs to be capitalised - Java Script functions and variables are always case-sensitive. Read more about the humble checkbox in our HTML5 Checkbox Validation article.
Radio buttons are implemented as if they were an array of checkboxes.
It can prevent people from leaving fields blank, from entering too little or too much or from using invalid characters.
For an alternative approach to client-side form validation, without Java Script, check out our new article on HTML5 Form Validation which is available now in most modern browsers.
Live demo: Longmuir/pen/Wb Oydx data-validate is injected in all the input fields of your form but when using js Form Validator, you don't require this heavy syntax and the validation will be applied to your form in one shot, without need to touch at your HTML code.So i have places to insert the stop validation code, but just cant find any that works.I tested your first piece of code on a form and it does not work at all.The purpose of a form validation script is to return a boolean value ('s to reference form fields, but that can lead to namespace conflicts and why make things more complicated than necessary.When the form is submitted - either by hitting Enter or clicking on the Submit button - the (the 'value' of the field called 'input' belonging to the form). In a real-life situation you will most likely have more fields to check, and more complicated conditions, but the principle remains the same.