The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
Checkbox validation with JS (RSV) - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Modules / Other (https://forums.formtools.org/forumdisplay.php?fid=8)
+--- Forum: Form Validation: JS + PHP (https://forums.formtools.org/forumdisplay.php?fid=18)
+--- Thread: Checkbox validation with JS (RSV) (/showthread.php?tid=740)



Checkbox validation with JS (RSV) - ebirer - Jun 10th, 2010

Hi there,

I want to validate a checkbox group with JS, but when i use the statement:
Code:
rules.push("required,accomodationtype[],Please check all that apply");
for this kind of checkbox group:
Code:
<INPUT type="checkbox" name="accomodationtype[]" id="accomodationtype_0" value="hotel1">Hotel1<BR>
<INPUT type="checkbox" name="accomodationtype[]" id="accomodationtype_1" value="hotel2">Hotel2<BR>
<INPUT type="checkbox" name="accomodationtype[]" id="accomodationtype_2" value="hotel3">Hotel3<BR>
<INPUT type="checkbox" name="accomodationtype[]" id="accomodationtype_5" value="other"> Other (please specify)<BR>
<INPUT type="text" name="accomodationtypeother" id="accomodationtypeother">

It doesn't validate and it immediately posts the form.
I am not sure if i am doing something wrong.

Can anybody help this situation?

Thanks in advance..
I found the solution by myself Smile

I forgot the slashes, it needs to be like this:
Code:
rules.push("required,accomodationtype\[\],Please check all that apply");



RE: Checkbox validation with JS (RSV) - waizen - Sep 2nd, 2010

This looks like it's on the right track for a situation I'm having, except for one thing:

the name="whatever" within each check box input seems to need to be the same across the check box group in order for the validation to work.

In my case, though, I need for each checkbox to still act independently of each other...needing to have different names attached to each. Long story why...let's just say I have a 3rd party app form tools needs to interact with that requires different database tables...one for each check box data.

Any way to group a set of check boxes to validate as a group, but still maintain their individuality? Did that question make sense?


RE: Checkbox validation with JS (RSV) - mary123 - Feb 6th, 2011

Hi,
I placed the csv file on the server and created a php file with the recommended codes. However, when I filled out the form and clicked on Submit, the entries were gone but I didn't see the 'Successfully Saved' message, and of course there was no entry into the csv file.

Also when I tested leaving out some fields and clicked on Submit, I did not get the error message in the code. However, I have php 5.11 installed on the computer and all the php forms for another website work well. Do you have any idea what had gone wrong on my side?

Thanks!!


RE: Checkbox validation with JS (RSV) - QuintonMedina - Mar 28th, 2011

Excellent post.I want to thank you for this informative. I really appreciate sharing this great post.


RE: Checkbox validation with JS (RSV) - JMW - Apr 18th, 2011

Thanks, I was wondering how to verify if any checkbox selections had been made.
Works fine for me so far.