Validating multiple checkboxes using javascript dating while separated in pa

29 Apr

I need the JS to require a user to select at least 1 checkbox, but the user can also select multiple checkboxes. When the user clicks submit, if they haven't selected one of the check boxes then a message should appear and not let the user submit the email. I am new to JS, so I would need the code and how to make it work. This will also require a slight change in the javascript code: hi john thanks very much your code works great.tell me one thing that i have to validate 3 more fields (fname,age,city). if(document.form1.fname.value == '') if(document.form1value == '') if(document.form1value == '') where should i put this code in your provided function.If you know php then should i insert the php code here for you to see whats wrong.

I have a form with 2 different group of check boxes that are all required to have different names.hi all i have one form in which i have multiple checkbox options for the user to select.i have inserted the validation script in this form which alert the user if the user has not selected any of the checkbox options.The type of validation I need is that the user must select at least one option from Group 1 and at least one option from Group 2 before the form allows them to submit.I'm sure there is some way to do this in JQuery or Java Script but I have little to none experience in both and most of what I have found online requires the name attribute to be the same which I can't have.