dsp77 Posted May 18, 2011 Share Posted May 18, 2011 Hello, i have a form with 60 check boxes (different id/name)and i don't know how can i validate (with js) to be check at least one. any advise ? Quote Link to comment https://forums.phpfreaks.com/topic/236739-multi-check-boxes-validation-at-least-one/ Share on other sites More sharing options...
nogray Posted May 19, 2011 Share Posted May 19, 2011 you can use document.getElementsByTagName('input') which will return an array with all the input elements. Loop through it and check if the type is "checkbox" Quote Link to comment https://forums.phpfreaks.com/topic/236739-multi-check-boxes-validation-at-least-one/#findComment-1217360 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.