option 2 option 2b "> option 3 It appears somewhere in the php code a "optgroup" is recognized, since it is generated into html. :? 3) The following stacktrace may give a clue to where parsing is performed: * ChronoForms\admin\helpers\plugin.php : line 271 * http://api.joomla.org/__filesource/fsource_Joomla-Framework_HTML_joomlahtmlhtmlselect.php.html#a151 * http://api.joomla.org/__filesource/fsource_Joomla-Framework_HTML_joomlahtmlhtmlselect.php.html#a64Although I've found the code lines responsible for generating the html output, I cannot make out how to tweak the code or input to build a proper OPTGROUP into the SELECT element.If anyone with more experience can help out, it would be greatly appreciated.Thanks in advance. 🙄"> How? SELECT with OPTGROUP - Forums

Forums

How? SELECT with OPTGROUP

marcow 02 Sep, 2010
I'm really keen on getting an OPTGROUP into the SELECT element. Browsing through the sources of both ChronoForms and Joomla, there seems to be a way. However I cannot get it to work. 😢 Here's what I've found:

1) In the Form Wizard I've added a DropDown and set the Options field to this:

  option 1
  <OPTGROUP>,Blah
  option 2
  option 2b
  </OPTGROUP>
  option 3

2) After saving the form and reviewing the output the HTML is generated as such:

  <select name="select_5" title="" size="1" id="select_5" class="cf_inputbox">
  <option value="">Choose Option</option>
  <option value="option 1">option 1</option>
  <option value="<OPTGROUP>,Blah"></option>
  <optgroup></optgroup>
  <option value="option 2">option 2</option>
  <option value="option 2b">option 2b</option>
  <option value="</OPTGROUP>"></option>
  <option value="option 3">option 3</option>
  </select>

It appears somewhere in the php code a "optgroup" is recognized, since it is generated into html. :?

3) The following stacktrace may give a clue to where parsing is performed:

   * ChronoForms\admin\helpers\plugin.php : line 271
   * http://api.joomla.org/__filesource/fsource_Joomla-Framework_HTML_joomlahtmlhtmlselect.php.html#a151
   * http://api.joomla.org/__filesource/fsource_Joomla-Framework_HTML_joomlahtmlhtmlselect.php.html#a64

Although I've found the code lines responsible for generating the html output, I cannot make out how to tweak the code or input to build a proper OPTGROUP into the SELECT element.

If anyone with more experience can help out, it would be greatly appreciated.
Thanks in advance. 🙄
GreyHead 02 Sep, 2010
Hi marcow,

The Wizard doesn't know about <optgroups> (I have no idea how you got one created there). You can add them manually in the Form HTML box though.
<select name="select_5" title="" size="1" id="select_5" class="cf_inputbox">
<option value="">Choose Option</option>
<option value="option 1">option 1</option>
<optgroup label='Blah'>
<option value="option 2">option 2</option>
<option value="option 2b">option 2b</option>
</optgroup>
<option value="option 3">option 3</option>
</select>


Bob
marcow 02 Sep, 2010
I realize that the html can be entered straight into the html form code. Yet this wizardly stuff is just about enough for the authors in joomla to build their own form. Anything deeper like html code is way over their head.

Therefor I looked at using the select element and simply entering the text 'optgroup' in the options text area. After saving the form, and recalling the form using the regular joomla url, the optgroup is generated in the html form.

The original post describes this in step 1 and 2. I'm now wondering, since Joomla supports "<optgroup>", can the chronoforms code be adjusted to improve the support also. If I could enter the text below using the wizard, that would save a lot of pain writing html code.


item0_ungrouped
<OPTGROUP>=groupA
item1_group_a
item2_group_a
</OPTGROUP>
<OPTGROUP>=groupB
item1_group_b
item2_group_b
</OPTGROUP>
item1_also_ungrouped


Regards.
GreyHead 02 Sep, 2010
Hi marcow,

Possibly it could be hacked. I don't think that Max has any plans to update this version of the Wizard though :-(

Bob
This topic is locked and no more replies can be posted.