Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Re: Display (print) selected value

by bigj (Monk)
on Oct 21, 2002 at 09:04 UTC ( [id://206797]=note: print w/replies, xml ) Need Help??


in reply to Re: Display (print) selected value
in thread Display (print) selected value

Allthough I would suggest to remove some redundancy in the code to make it a bit more readable:
print qq|<form action="test.cgi" method="post">\n|, qq|<center><select name="selected" size="1">\n|; foreach ($item1, $item2, $item3, $item4, $item5) { my $selected_flag = $input{selected} eq $_ ? "selected" : ""; print qq|<option value="$_" $selected_flag> $_ </option>\n|; } print qq|<INPUT type="submit" name="submit" value="Select"\n|, qq|</form><p><br>\n|, qq|</select>\n|;
Of course, I'd like also recommend to use the CGI module.

Greetings,
Janek

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://206797]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2024-04-20 03:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found