Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

HTML::Template & HTML Elements

by BlenderHead (Novice)
on May 31, 2009 at 02:23 UTC ( #767098=perlquestion: print w/ replies, xml ) Need Help??
BlenderHead has asked for the wisdom of the Perl Monks concerning the following question:

Hello Everyone:

I am intermediate level Perl programmer, but this is my first post here, so please bear with me for being new.

I dont have any simple example for this question, so I'll just have to talk it out. Hopefully, it will make sense enough to answer.

Am working on a CGI app using HTML::Template. It gets the user to complete a fill out form with text fields, radio buttons and a pulldown menu. After the form is completed it reposts the information (in a validation phase) and offers the author the option to edit the input. The problem occurs when the user wishes to edit the information.

When the user clicks "Edit" the idea is for them to refer back to the form with the previously inserted information. It is easy enough to pass the parameters back into the text fields, but the information in the radio buttons and pull down menus isn't resetting those fields to where the user left off.

Anyone have any ideas on how to handle this?

Thanks,

BlenderHead

Comment on HTML::Template & HTML Elements
Re: HTML::Template & HTML Elements
by almut (Canon) on May 31, 2009 at 03:12 UTC
    ...but the information in the radio buttons and pull down menus isn't resetting those fields to where the user left off.

    Are you setting the appropriate CHECKED attribute (for radio buttons) and SELECTED (for option menus)?

    BTW, CGI.pm has a "sticky" form fields facility, which should do just about that automagically.  (Update: ah well, on second read I realize you're using HTML::Template for HTML generation (it's even in the title! :) — so ignore that note about CGI.pm... )

Re: HTML::Template & HTML Elements
by jonnyfolk (Vicar) on May 31, 2009 at 06:30 UTC
    The information here might be useful.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://767098]
Approved by GrandFather
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2014-10-21 06:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (97 votes), past polls