"be consistent" | |
PerlMonks |
CGI lib questionby hok_si_la (Curate) |
on Feb 02, 2005 at 19:13 UTC ( [id://427379]=perlquestion: print w/replies, xml ) | Need Help?? |
hok_si_la has asked for the wisdom of the Perl Monks concerning the following question:
Greetings again wizards of the web, I have just migrated all of my forms over to use the CGI lib. Several of them work in the following manner: form 'A' -> script 'B' onclick list element -> form 'C'. For clarification hers is an example. Search for all servers in Texas (form A) yields 30 servers in a list (script B). When one of these servers is clicked form C is displayed which shows the selected server information which can be edited by an admin. Now the problem. Form C will have defaults for most all fields that are not in use. This means that in order to populate the form elements with the values from my SQL table, I need to pass them through CGI headers. That would not be a problem if I weren't using tab functions that allow users to navigate back and forth from one site to another. I noticed that I can use the unescape() utility in the following fashion: $ENV{QUERY_STRING}=unescape($ENV{QUERY_STRING}); #--Needed for form element population. This actual populates the elements with the correct value when the invoking script escapes a URL string to allow for textarea formatting. First question: How many thousands of things can go wrong by altering $ENV{QUERY_STRING}? Second Question: If it is okay to use the above statement then I can effectively populate the form elements by creating a string from my table query and setting it to $ENV{QUERY_STRING}. Otherwise Is there a function in the CGI lib that I overlooked that accommodates both element default values and element values?
Back to
Seekers of Perl Wisdom
|
|