|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Validating Checkbox arrays
Hello, I have been having this problem, getting my values from a checkbox to validate, the reason is because they are in arrays, and I can't seem to figure out how to validate arrays. My script for the input looks like this
<input type="checkbox" name="radiobuttons[]" value="Gestion de Procesos"> <input type="checkbox" name="radiobuttons[]" value="Gestión Documental"> of course I have 10 of these, but I can't figure out how to validate them, I tried something like this if(!document.theform.radiobuttons[0]) && (!document.theform.radiobuttons[1]) && (!document.theform.radiobuttons[2]) { alert "Please enter an option"; return false; } but it doesn't seem to work. Any suggestions on how to set this up would be greatly appreciated. Thanks! |
|
#2
|
||||
|
||||
|
arrays
Hi iggy1253, welcome to the forums,
Maybe this validation article will help. http://www.devarticles.com/c/a/JavaScript/Developing-a-simple-validation-library-in-JavaScript/ http://www.devarticles.com/c/a/JavaScript/Developing-a-simple-validation-library-in-JavaScript-continued/ and if you want more try http://www.devarticles.com/c/a/JavaScript/An-in-depth-discussion-of-JavaScript-Arrays/ |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Validating Checkbox arrays with javascript for a php mail script |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|