Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

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?



Replies are listed 'Best First'.
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, 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 )

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://767098]
Approved by GrandFather
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (13)
As of 2016-12-05 16:17 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (88 votes). Check out past polls.