[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=|
1=Junior High School,
2=High School,
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

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]

<input type="radio" name="publish_email" value="0" id="publish_email0">
     &nbsp;<label for="publish_email0">No</label>
<input type="radio" name="publish_email" value="1" id="publish_email1"  
     &nbsp;<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  


Josh Lavin
Perusion -- Expert Interchange Consulting    http://www.perusion.com/

More information about the interchange-users mailing list