jZed has asked for the wisdom of the Perl Monks concerning the following question:
update thanks to Fletch and Scooterm I've clarified my goals a bit, please see my reply below that has some goal clarifications
Name : ??? CGI::FormBuilder::Text2Form ???
Purpose : Allow a lightly marked up text file to be autogenerated into an HTML survey form. Markup will be parsed and fed into (probably) CGI::FormBuilder
Sample Input file:
%%start action="/somepath/foobar-survey.cgi" %%text Name %% 30 %%radio Gender %% Male %% Female %%checkbox Location %% Heaven %% Hell %% Purgatory %%popup Occupation %% Student %% Flunky %% Other %%textarea Complaints(Please list your complaints here.) %% 60 %% 4 %%endThese could be intersperced with pod lines - lines that start with %% would be interpreted as form markup, other lines would be interpreted as pod (i.e. flush left would be wrapped and interpolated and indented would be verbatim)
Quick Guide to markup
%%start $start_form_attributs
%%text $name %% $width
%%textarea $name %% $width %% height
%%radio $name %% $value1 %% $value2 ... %% $valueN
%%checkbox same as radio
%%popup same as radio
%%submit $name
%%end
$name - the name of the field
$value - value of a radio, checkbox or popup item
$width - width of a text field or area
$height - height of a text field or area
Labels and prompts will be created from $name and $value unless
you put a label/prompt in parentheses after $name or $value.
For example:
%%text City
Will create a textfield with "City" as both the field name
and the label/prompt.
%%text fname (Please enter your First Name)
Will create a textfield with the name "fname" and the prompt as
shown in the parentheses.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Generating an HTML survey form from simple markup
by Fletch (Bishop) on Feb 03, 2005 at 16:54 UTC | |
by jZed (Prior) on Feb 03, 2005 at 17:02 UTC | |
by Fletch (Bishop) on Feb 03, 2005 at 17:33 UTC | |
by jZed (Prior) on Feb 03, 2005 at 17:47 UTC | |
by clscott (Friar) on Feb 04, 2005 at 16:59 UTC | |
|
Re: Generating an HTML survey form from simple markup
by dimar (Curate) on Feb 03, 2005 at 17:54 UTC | |
by jZed (Prior) on Feb 03, 2005 at 18:07 UTC | |
|
Re: Generating an HTML survey form from simple markup
by ikegami (Patriarch) on Feb 03, 2005 at 16:57 UTC |