The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (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.31 (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.31 (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.31 (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.31 (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.31 (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 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined property: MyLanguage::$archive_pages - Line: 2 - File: printthread.php(257) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/printthread.php(257) : eval()'d code 2 errorHandler->error
/printthread.php 257 eval
/printthread.php 117 printthread_multipage
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
problem with submitting values multiple select - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1)
+--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5)
+--- Thread: problem with submitting values multiple select (/showthread.php?tid=603)

Pages: 1 2 3


problem with submitting values multiple select - bvdveen - Mar 24th, 2010

Hi all,

After weeks of tailoring quiet a complex form with about 92 validation rules I discovered that values chosen from a multiple select box are not submitted to the views within form tools.

The multiple values chosen from multiple selectbox B are preceded by a choice from a select box A (not multiple) that generates a list in checkbox B. (hope I formulated this clearly)

Somewhere in the documentation Ben mentiones that for checkboxes or multiple select boxes the field names must contain '[]' . I have searched and searched and could not find an answer in the documentation.

Has anyone encountered the same problem?

I would be glad to have some advice.

Thanks in advance!

Bert


RE: problem with submitting values multiple select - Ben - Mar 28th, 2010

Hi Bert,

Yes, that's exactly it: PHP requires you to enter [] characters at the end of the name attribute value in order to let the server know to expect multiple values. e.g.

Code:
<select name="myfield[]" multiple size="5"> ... </select>

But within Form Tools, the form name field should just be "myfield" (no square brackets).

This is again an odd PHP-ism.

So you've tried this without any luck?

- Ben


RE: problem with submitting values multiple select - bvdveen - Mar 28th, 2010

(Mar 28th, 2010, 4:20 PM)Ben Wrote: Hi Bert,

Yes, that's exactly it: PHP requires you to enter [] characters at the end of the name attribute value in order to let the server know to expect multiple values. e.g.

Code:
<select name="myfield[]" multiple size="5"> ... </select>

But within Form Tools, the form name field should just be "myfield" (no square brackets).

This is again an odd PHP-ism.

So you've tried this without any luck?

- Ben

Hi Ben,

Thanks for your always so quick answer. I really like the way you treat messages in general....a compliment!

However...(as you might expect...;-).

First of all I do not use PHP (yet) in the form I mentioned. I do not (yet) make use of the Form Tools API. I only use HTML and rsv.js. Part of the rules (of in total 197 rules!) I apply follows below:

rules.push("required,date1,vul de datum in.");
rules.push("required,mw,hoe heet je?");
rules.push("required,pr_AZ,projectnaam goed invullen.");
rules.push("required,wrks_cat1,kies een werksoort.");

pr_AZ is a select box where users can pick a letter from the alfabet.
This triggers a javascript that via an array produces a list in a field 'pr_naam' : a multiple select box where users can select more values (with Ctrl) starting with the letter (A-Z) from 'pr_AZ'.

Problem is that those values do not appear within form tools.

Now:

1. where exactly do I make sure the field value has [] brackets?
2. in the rule? in the form field name? and how am I sure that within form tools the right field value(s) appear(s)?
3. Could the javascript used to automatically trigger the list in 'pr_naam' be the cause of the problem?

In the body part the code goes:

<select name="pr_AZ" id="pr_AZ" onChange="pr_AZ_OnChange()" class="selectAZ"><option value=""></option><option value="A">A</option><option value="B">B</option><option value="C">C</option><option value="D">D</option><option value="E">E</option><option value="F">F</option><option value="G">G</option><option value="H">H</option><option value="I">I</option><option value="J">J</option><option value="K">K</option><option value="L">L</option><option value="M">M</option><option value="N">N</option><option value="O">O</option><option value="P">P</option><option value="Q">Q</option><option value="R">R</option><option value="S">S</option><option value="T">T</option><option value="U">U</option><option value="V">V</option><option value="W">W</option><option value="X">X</option><option value="Y">Y</option><option value="Z">Z</option></select>
<select id="pr_naam" name="pr_naam" class="selectmultiple"><option value=""></option></select></li>



I hope to have provided you with enough information to go on.

Thanks again in advance!


Bert.

I retried the form submission using brackets and now it produces (,,) as values....


RE: problem with submitting values multiple select - bvdveen - Mar 29th, 2010

I think the problem lies in the fact that the javascript mentioned produces the list and therefore is not 'seen' by formtools. Would it help to manually add form field values (as the form field select box pr_naam contains no values) ?

Thanks again!
(Mar 29th, 2010, 1:29 AM)bvdveen Wrote: I think the problem lies in the fact that the javascript mentioned produces the list and therefore is not 'seen' by formtools. Would it help to manually add form field values (as the form field select box pr_naam contains no values) ?

Thanks again!

I tested the form with formtools 1,51 and had no problems....


RE: problem with submitting values multiple select - Ben - Apr 3rd, 2010

Hey Bert,

Sorry for the wait!

Quote:1. where exactly do I make sure the field value has [] brackets?

Even if your page is just HTML, any multi-select fields will need to have those brackets at the end of the select box's name attribute. So, your HTML would look like this:

Code:
<select id="pr_naam" name="pr_naam[]" class="selectmultiple"><option value=""></option></select>

But also, I'm pretty sure you'll need to add a "multiple" attribute to allow the users to be able to select multiple items, so try this:

Code:
<select id="pr_naam" name="pr_naam[]" class="selectmultiple" multiple><option value=""></option></select>

Quote:2. in the rule? in the form field name? and how am I sure that within form tools the right field value(s) appear(s)?

I'm not quite following you here... but in terms of seeing the info in Form Tools, I'd suggest doing this: temporarily change the field type for the "pr_naam" within Form Tools to a textarea field. That'll be easiest to see what values are actually being stored by Form Tools for each form submission. Once it's been ascertained that it is indeed storing multiple values (separated by a ", "), you can go back and change it back to a multi-select field with the appropriate dropdown values.

Quote:3. Could the javascript used to automatically trigger the list in 'pr_naam' be the cause of the problem?

I really do think it's just a configuration problem in the form - Form Tools doesn't care HOW the form is actually created. You could use JS to construct the entire form - form element included! - as long as it receives a POST request, it's happy.

If you like, post me back with a link to the form and I could take a look to confirm the form looks okay.

- Ben


RE: problem with submitting values multiple select - bvdveen - Apr 8th, 2010

(Apr 3rd, 2010, 4:23 PM)Ben Wrote: Hey Bert,

Sorry for the wait!

Quote:1. where exactly do I make sure the field value has [] brackets?

Even if your page is just HTML, any multi-select fields will need to have those brackets at the end of the select box's name attribute. So, your HTML would look like this:

Code:
<select id="pr_naam" name="pr_naam[]" class="selectmultiple"><option value=""></option></select>

But also, I'm pretty sure you'll need to add a "multiple" attribute to allow the users to be able to select multiple items, so try this:

Code:
<select id="pr_naam" name="pr_naam[]" class="selectmultiple" multiple><option value=""></option></select>

Quote:2. in the rule? in the form field name? and how am I sure that within form tools the right field value(s) appear(s)?

I'm not quite following you here... but in terms of seeing the info in Form Tools, I'd suggest doing this: temporarily change the field type for the "pr_naam" within Form Tools to a textarea field. That'll be easiest to see what values are actually being stored by Form Tools for each form submission. Once it's been ascertained that it is indeed storing multiple values (separated by a ", "), you can go back and change it back to a multi-select field with the appropriate dropdown values.

Quote:3. Could the javascript used to automatically trigger the list in 'pr_naam' be the cause of the problem?

I really do think it's just a configuration problem in the form - Form Tools doesn't care HOW the form is actually created. You could use JS to construct the entire form - form element included! - as long as it receives a POST request, it's happy.

If you like, post me back with a link to the form and I could take a look to confirm the form looks okay.

- Ben

Hi Ben,

I hope you had a nice Easter weekend!

As to my form...I hace tried all the possibilities you mentioned. Probably oversaw a small item!
Actually the problem lies in the names wrks_naam1[] and wkrs_naam2[]..

Thanks again for your reply!

Greetings

Bert

I will inculde a link to the form, as it is to big to post here I guess...


RE: problem with submitting values multiple select - Ben - Apr 10th, 2010

Hi Bert,

So did you figure it out? You mentioned you thought the problem lies in those field names? The markup you posted looks fine.

How about this part? Did you try this out?

Quote:I'm not quite following you here... but in terms of seeing the info in Form Tools, I'd suggest doing this: temporarily change the field type for the "pr_naam" within Form Tools to a textarea field. That'll be easiest to see what values are actually being stored by Form Tools for each form submission. Once it's been ascertained that it is indeed storing multiple values (separated by a ", "), you can go back and change it back to a multi-select field with the appropriate dropdown values.

All the best!

- Ben


RE: problem with submitting values multiple select - bvdveen - Apr 10th, 2010

Hi Ben,

Thanks again for your answer.
It doesn't seem to work out...
When I submit the same form to formtools vs 1.51 I have no problems at all..maybe something I overlooked in general?

Oh, I must say three comma's appear in one of the mentioned multiple select fields...

Greetings

Bert
Hi Ben,

I might have resolved the problem!

I adjusted the field types to select and multiselect and then back to textarea...and now the fields are filled in!

Still a little bit weird though....

Greetings

Bert


RE: problem with submitting values multiple select - bvdveen - Apr 11th, 2010

Hi Ben,

A last question...

As you could see in the form I heve used a rule:

rules.push("digits_only,aantal_groen,alleen cijfers invullen!(groen)");

I would like users to give the opportunity to use a comma, si I tried:

rules.push("reg_exp,aantal_groen,^\s*(0|1|2|3|4|5|6|8|9|\,\)\s*$,i,alleen cijfers en komma!");

it doesn't seem to work....the form submits without java errors....

Any idea?

Hope you can help me with this.....

Thanks again!

Greetings

Bert van der Veen


RE: problem with submitting values multiple select - bvdveen - Apr 12th, 2010

Hi Ben,

Sorry to bother you again...from your posts I know you must be very busy. Well so am I as you can see :-)

The so-called solution (better call it work-around I guess) I mentioned above works for FT 1.51 and for FT 2.0. Meaning: changing the multiple select fields within ft into text-area's solved the problem! (for me)
I would like to know however if the 'better' solution exists...

Also...couold you give me a hand with the reg_exp rule I tried to write mentioned above?

Quote:I would like users to give the opportunity to use a comma, I tried:

rules.push("reg_exp,aantal_groen,^\s*(0|1|2|3|4|5|6|8|9|\,\)\s*$,i,alleen cijfers en komma!");

it doesn't seem to work....the form submits without java errors....
Thank you for your help again!

Greetings

Bert