in reply to Re^2: Formbuilder: generate id, that includes formname
in thread Formbuilder: generate id, that includes formname
I see, a misunderstanding. Documentation shows
And that matches my experience (s/_input/_field/), this code<tr id="${form}_${field}_row"> <td id="${form}_${field}_label">Label</td> <td id="${form}_${field}_input"><input tag></td> <td id="${form}_${field}_error">Error</td><!-- if invalid +--> </tr>
produces this html#!/usr/bin/perl -- use strict; use warnings; use CGI::FormBuilder; my $form = CGI::FormBuilder->new( name => 'acctinfo'); $form->field(name => 'fname', label => 'First Name'); $form->field(name => 'lname', label => 'Last Name'); print $form->render(header => 1);
<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en_US" xml:lang="en_U +S"> <head> <title> </title> </head> <body bgcolor="white"> <h3> </h3> <!-- Generated by CGI::FormBuilder v3.0501 available from www.formbuil +der.org --> <form action="-" id="acctinfo" method="get" name="acctinfo"> <div id="acctinfo_state"><input id="_submitted_acctinfo" name="_submit +ted_acctinfo" type="hidden" value="1" /></div> <table id="acctinfo_body"> <tr id="acctinfo_fname_row" valign="top"> <td id="acctinfo_fname_label">First Name</td> <td id="acctinfo_fname_field"><input id="fname" name="fname" type="t +ext" /></td> </tr> <tr id="acctinfo_lname_row" valign="top"> <td id="acctinfo_lname_label">Last Name</td> <td id="acctinfo_lname_field"><input id="lname" name="lname" type="t +ext" /></td> </tr> <tr id="acctinfo_submit_row" valign="top"> <td align="center" colspan="2" id="acctinfo_submit_field"><input id= +"acctinfo_submit" name="_submit" type="submit" value="Submit" /></td> </tr> </table> </form> </body> </html>
#!/usr/bin/perl -- use strict; use warnings; use CGI::FormBuilder; my $form = CGI::FormBuilder->new( name => 'acctinfo'); $form->field(name => 'acctinfo_fname', label => 'First Name'); $form->field(name => 'acctinfo_lname', label => 'Last Name'); print $form->render(header => 1);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Formbuilder: generate id, that includes formname
by Wolfgang (Novice) on Oct 06, 2009 at 13:31 UTC | |
by Anonymous Monk on Oct 06, 2009 at 13:47 UTC |