[ic] Allow "id" attribute in display tag
Josh Lavin
josh-ic at att.net
Fri Oct 23 20:21:40 UTC 2009
Here is a diff which updates lib/Vend/Form.pm to allow passing of "id"
to the [display] tag. It will be output in the form element and a
label element will be created to match, if appropriate.
Example 1:
[display id=category options=|
=--select--,
1=Junior High School,
2=High School,
3=College,
4=Graduate School,
| value="[evalue category]" type=select name=category]
Output (bring your own <label for=category>):
<select name="category" id="category">
<option value="" SELECTED>--select--
<option value="1">Junior High School
<option value="2">High School
<option value="3">College
<option value="4">Graduate School
</select>
Example 2 (label elements provided):
[display name=publish_email value="[evalue publish_email]" type=radio
passed="0=No,1=Yes" blank_default=1 id=publish_email]
Output:
<input type="radio" name="publish_email" value="0" id="publish_email0">
<label for="publish_email0">No</label>
<input type="radio" name="publish_email" value="1" id="publish_email1"
checked>
<label for="publish_email1">Yes</label>
--
Update Form.pm to support id attribute on form elements
Allows use of id="your-id" in [display] tag, which will output to form
element as "id" attribute and <label> tag as "for" attribute. By Mike
Heins.
http://github.com/jlavin/interchange/commit/54cc71f3170a061613fa2d090efac64b19ae92e2
--
Josh Lavin
Perusion -- Expert Interchange Consulting http://www.perusion.com/
More information about the interchange-users
mailing list