Contact Form: Dropdown inherits values of radio buttons

Creating and modifying plugins.
Post Reply
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Contact Form: Dropdown inherits values of radio buttons

Post 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.
=Don=
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

Bump....
=Don=
mgroeninger
Regular
Posts: 546
Joined: Mon Dec 20, 2004 11:57 pm
Contact:

Post 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.)
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

Thanks for everything Matt! Works perfectly!!!
=Don=
Post Reply