
japhy
Enthusiast
/ Moderator
Dec 16, 2000, 8:06 AM
Post #5 of 6
(2337 views)
|
Re: How Can i Back Data Form CSV File To Form?
[In reply to]
|
Can't Post
|
|
Since the radio button can only have one value attributed to it (technically), I would do away with $radio_1, $radio_2, and $radio_3, and just have a variable which states which radio button was selected.
for (1, 2, 3) { $rnum = $_, last if $radio eq "Choice $_"; } If the values are more complex than "Choice 1", "Choice 2", etc., then put them in an array, and go over it by index (yes, by index!):
@hated_food = ( "asparagus", "arugula", "brussel sprouts", "spinach", "pig's feet", "liver", ); for (0 .. $#hated_food) { $rnum = $_ if $radio eq $hated_food[$_]; } Jeff "japhy" Pinyan -- accomplished hacker, teacher, lecturer, and author
|