Forums

selectlist with multiple

tullski 15 Sep, 2008
Hi,

i have a selectlist like this
<select name="cb_sprachen" size="16"  multiple="multiple" >
  <option value="Albanisch">Albanisch</option>
  <option value="Armenisch">Armenisch</option>
  <option value="Bosnisch">Bosnisch</option>
....  </select>


Result: only the last selcted language get submitted or written to db.


If i have something like this
<select name="cb_sprachen[]" size="16"  multiple="multiple" >
  <option value="Albanisch">Albanisch</option>
  <option value="Armenisch">Armenisch</option>
  <option value="Bosnisch">Bosnisch</option>
....  </select>


Result: nothing gets submitted

Any ideas how to transfer an array?
J1.5 and current CF versions.

Thx
M
Max_admin 15 Sep, 2008
Hi tullski,

try to get the BETA 2.1 version from the forums here or wait a day or two for the new stable release, I think there was some issue with this.

Regards

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
tullski 19 Sep, 2008
Hi,

so just updated to the stable version!

But still the problem with the multiple select don`t seem to be fixed.

<select name="cb_sprachen" size="16"  multiple="multiple" >
  <option value="Albanisch">Albanisch</option>
  <option value="Armenisch">Armenisch</option>
  <option value="Bosnisch">Bosnisch</option>
....  </select>

Only the last value gets saved to DB and sent via email

<select name="cb_sprachen[]" size="16"  multiple="multiple" >
  <option value="Albanisch">Albanisch</option>
  <option value="Armenisch">Armenisch</option>
  <option value="Bosnisch">Bosnisch</option>
....  </select>


Nothing gets saved to DB and but sent correct Array via email
🤨

Any ideas?

Thx
M
Max_admin 19 Sep, 2008
Hi, your DB connection is set to work before or After Email ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
tullski 20 Sep, 2008
Hi,

you mean at the Autogenerated Code Tab?
Saving Data/Emails order:
tried both before and after.
No luck.
Max_admin 20 Sep, 2008
Hi, please put here your form backup and I will try it myself and see!

Regards

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Max_admin 21 Sep, 2008
Hi,

I confirm this is a bug, please add this line of code to the onsubmit after email box to fix :


<?php
JRequest::setVar('field_name', implode(", ",JRequest::getVar('field_name', array(), 'post', 'array')));
?>


you will replace field_name with cb_sprachen at this case of course!

let me know!

Regards

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
tullski 21 Sep, 2008
kewl!
It`s working!
Thx!!
tullski 22 Sep, 2008
Hi,

everything gets saves proper now.
i am reusing this multiple select list on a profile page.
How can preselect the saved values from the array?

<option value="Albanisch" selected="{cb_sprachen[]}">Albanisch </option>
<option value="Albanisch" selected="{cb_sprachen}">Albanisch </option>

don't work

thx
M
Max_admin 23 Sep, 2008
Hi tullski,

this will need some PHP coding, not easy to do actually, check our faqs for a topic about repopulating form data after failed captcha, it may help you!

Regards

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.