In a checkbox group, how do I enable selection of more than one item? I've tried adding an array handler to the on-submit, but that makes no difference.
Thank you.
Thank you.
Don't know about v5 but you could either just do it in v6 OR add multiple checkboxes.
Hi margknox,
Please check that the Checkbox group has an array name ending in []
Bob
Please check that the Checkbox group has an array name ending in []
Bob
Thank you Bob. I don't see an array name at all, where do I look for it?
This is the debugger report...
Data Array
Errors
Debug Info
This is the debugger report...
Data Array
Array
(
[option] => com_chronoforms5
[chronoform] => ordercssa
[event] => submit
[Name] => Margory
[Email] => margknox@optusnet.com.au
[Delivery] => Testing form, What is the array name?
[Items] => Maintain-Sound-Mind
[g-recaptcha-response] => 03AOLTBLSPu1X8U-9Ejl3SPQUPZKvv4k7aH1JEGMApyQFtbTIutevOw2B-VEyhu6cNYA0YGHljz3QZKgQ_kqlbxqKmHvdoEH2tT_yLME0ZnoqTpNDWzhLyrRMM_1UoL89ndZ4vX5YjISJdMdzaTqcuNEqUUG2eI6wrWCankXEtfJFIB3taRQx3TFpnrz9SO34bLXBnHh9kq8n7Vm5mOWu3Z4JlYAaS1VDzPyidkFPSbo9DmovC2AREv6cQt2_y6nQm_GcWZCo92-q4n8LYpud5W-uTKiAOIi0r_aorluiJODMMcYLycboHL7DggzRd4LZp6-R_INIP4QRd
[button6] => Submit
[cf_id] => 1
[ip_address] => 103.66.28.32
)
Array
(
)
Errors
Array
(
)
Debug Info
Array
(
[5] => Array
(
[DB Save] => Array
(
[Queries] => Array
(
[0] => INSERT INTO `qwvde_cf_ordercssa` (`Name`, `Email`, `Delivery`, `Items`, `user_id`, `uniq_id`, `created`) values ('Margory', 'margknox@optusnet.com.au', 'Testing form, What is the array name?', 'Maintain-Sound-Mind', '0', 'fd407fc4a120f24681be15659926690a48b8f754', '2019-06-18 05:04:08');
)
)
)
[7] => Array
(
[Email] => Array
(
[0] => An email with the details below was sent successfully:
[1] => To:info@xxx.com
[2] => Subject:Order from CSSSA website
[3] => From name:Christadelphian Support Service SA
[4] => From email:contact@xxx.org
[5] => CC:
[6] => BCC:
[7] => Reply name:
[8] => Reply email:
[9] => Attachments:
[10] => Array
(
)
[11] => Body:
[h2]Order Form[/h2]
[table][tbody][tr][td]Name[/td][td]Margory[/td][/tr][tr][td]Email[/td][td]margknox@xxx.com[/td][/tr][tr align="left" valign="top"][td]Delivery Address[/td][td]Testing form, What is the array name?[/td][/tr][tr][td]Items Required[/td][td]Maintain-Sound-Mind[/td][/tr][/tbody][/table]
IP: 103.66.28.32
)
)
)
array name as in an array-like name as in just put square brackets at the end like myfield[]
Thank you healyhatman. I added the square brackets to the checkbox group name as in Items[]
but the debugger returned the error message:
1054 - Unknown column 'Array' in 'field list'
but the debugger returned the error message:
1054 - Unknown column 'Array' in 'field list'
You probably have a database read based off of the selection, or a save data action? What is it?
It's a Database Save action. Multi save was set to No. When I set it to Yes, the report email returned all items selected, but in the following format:
array ( 0 => 'OneItem', 1 => 'OtherItem', 2 => 'AnotherItem',)
Presumably because my form hasn't submitted a "numerically indexed list of records." It's just the Yes=Yes, No=No format.
How do I numerically index my list please?
Thank you for your help.
array ( 0 => 'OneItem', 1 => 'OtherItem', 2 => 'AnotherItem',)
Presumably because my form hasn't submitted a "numerically indexed list of records." It's just the Yes=Yes, No=No format.
How do I numerically index my list please?
Thank you for your help.
I have moved the Handle Arrays action above everything else in On Submit, and the report email now lists the selected items without code:
OneItem, Otheritem, Anotheritem.
Much better, but still a horizontal list. How can I get the selected items to list vertically? Is that what a numerically indexed list does?
OneItem, Otheritem, Anotheritem.
Much better, but still a horizontal list. How can I get the selected items to list vertically? Is that what a numerically indexed list does?
Hi margnox,
You can change the list separator in the Handle Arrays action. Or you can use some custom PHP+HTML to handle the display of that element.
Bob
You can change the list separator in the Handle Arrays action. Or you can use some custom PHP+HTML to handle the display of that element.
Bob
Thank you Bob, I made the delimiter <br /> and now the items are listing fine.
But I now find that the test email records since the Multi Save has been Yes are not being saved to the database. What do I need to change here?
But I now find that the test email records since the Multi Save has been Yes are not being saved to the database. What do I need to change here?
Hi margknox,
Please add a Debugger action to see what MySQL query is being creates. It may be that the new <br />s are breaking the query.
Bob
Please add a Debugger action to see what MySQL query is being creates. It may be that the new <br />s are breaking the query.
Bob
Thank you Bob. I don't think changing the separator caused the problem. because no test emails have been saved since changing the Multi Save from No to Yes.
Here's the Debugger output:
Data Array
Errors
Debug Info
Here's the Debugger output:
Data Array
Array ( [option] => com_chronoforms5 [chronoform] => ordercssa [event] => submit [Name] => Millicent [Email] => margknox@optusnet.com.au [Delivery] => [Items] => Depress-Positive-Steps<br />Forgiveness-David-Hill<br />Cope-Tough-Times-Youth<br />Cope-Tough-Times-Parents [g-recaptcha-response] => 03AOLTBLSA9RxY66URAq7y1KvCPazGy88VzKdZsMoqjFkaYcQUF0WQ9Fw3tYAML782dsXGSLL458FLcJLlQzxcXxl-21UdLOOjHy-o5d2hb2QFD4K0-FYSxw-rUbCdMkCQ62_CTx5KPutmS0cGnEIZfJT9F8nxuISrs8VE07bvfiI-VSvubKZ4PBmqq4hcWQplsofm22dTNr0-LeQUfnPWBMFndgcllwJ8W2Vdh_3VwURfAroGoPmwB-D7akua2FwfPDpsMeYTKJeF7I3EpTjOM_zI6eGXiaFANcs1N5adIQIWBjdbYqTahrRrQDaS0gDFmSEpuh0lHv0z [button6] => Submit [cf_id] => 0 [ip_address] => 103.66.28.31 )
Array ( )
Errors
Array ( )
Debug Info
Array ( [5] => Array ( [DB Save] => Array ( [Queries] => Array ( ) ) ) [7] => Array ( [Email] => Array ( [0] => An email with the details below was sent successfully: [1] => To:info@marblebon.com.au [2] => Subject:Order from CSSSA website [3] => From name:Christadelphian Support Service SA [4] => From email:contact@supportnetwork.org.au [5] => CC: [6] => BCC: [7] => Reply name: [8] => Reply email: [9] => Attachments: [10] => Array ( ) [11] => Body: <h3>Order from CSSSA Website:</h3> <table> <tbody> <tr> <td>Name:</td> <td>Millicent</td> </tr> <tr> <td>Email:</td> <td>margknox@optusnet.com.au</td> </tr> <tr> <td valign="top">Ecclesia/Delivery Preference: </td> <td></td> </tr> <tr> <td valign="top">Items Required: </td> <td>Depress-Positive-Steps<br />Forgiveness-David-Hill<br />Cope-Tough-Times-Youth<br />Cope-Tough-Times-Parents</td> </tr> </tbody> </table><br /><br />IP: 103.66.28.31 ) ) )
Are you still getting the unknown column array message
Thanks healyhatman, No, that message disappeared when I changed the MultiSave from No to Yes. There's been no error message since then, and the admin email is fine.
The only problem is that the messages are not saving to the database, and haven't been since I changed the MultiSave.
The only problem is that the messages are not saving to the database, and haven't been since I changed the MultiSave.
This topic is locked and no more replies can be posted.