Page 1 of 1

Contact Form: Dropdown inherits values of radio buttons

Posted: Thu Mar 08, 2007 8:45 pm
by Don Chambers
Using the dynamicform.tpl, add both a radio button and a dropdown on the form using this form field string:

Code: Select all

Radio Button;radio;Yes,yes|No,no:Dropdown;select;Choice#1,choice#1|Choice#2,choice#2|Choice#3,choice#3
The drop down contains the values Yes, No, Choice#1, Choice#2, Choice#3. Am I specifying the string incorrectly, or is this a problem in either the tpl or php?

The reverse of this is also true - if the dropdown is first in the string, and the radio second, the radio options inherit the dropdown options.



As long as I am discussing the contactform, it would also be nice to have a label after a checkbox (like a radio button) IF such a label is provided. By default, the default tpl shows the same {$field.name} text before AND after the checkbox:

Code: Select all

<input class="frm_check" type="checkbox" name="{$field.id}" id="{$field.id}" {$field.default} />{$field.name}
My opinion, is that an optional label be allowed in the string, and this label appears after the checkbox. If that cannot happen, I think, at minumum, the {$field.name} should not follow the checkbox.

Posted: Mon Mar 12, 2007 5:41 pm
by Don Chambers
Bump....

Posted: Tue Mar 13, 2007 8:13 pm
by mgroeninger
Hey Owen,
Can you take a look at version 1.12 (I just added it to CVS). It should have both a bug fix to prevent option bleeds, and the change you requested to checkboxes...

You'll just need to separate the "message" to display after the checkbox and "checked" by a comma:

"Check Box;checkbox;Name displayed after checkbox,checked"

It also added an new smarty variable for the tpl, so you might want to look at the default dynamic tpl file again... (I think the new variable is called {$field.message})

This change should be backwards compatible.

Could you send me a PM if you have a problem? I might not check the boards for awhile again. (Feel free to post, too, but since I made the changes I'll be responsible for anything that I broke.)

Posted: Wed Mar 14, 2007 2:13 am
by Don Chambers
Thanks for everything Matt! Works perfectly!!!