Printing the word CHECKED is exactly what I want to do.
How about this:
print "Box 4: ", $FORM{'h04'} && 'CHECKED';
Better or worse?
--
Mark Dominus
Perl Paraphernalia
| [reply] [d/l] |
++, good solution. A minor change though, I often find it nicer with a printed text for both situations, i.e:
print "Box 4: ", $FORM{'h04'} ? 'CHECKED' : 'NOT CHECKED';
The 15 year old, freshman programmer,
Stephen Rawls | [reply] [d/l] |
Printing the word CHECKED is exactly what I want to do. I find it to be simpler to have
the variables set in advance as opposed to incorporating them into my print statements
which would then require an alternative else statement.
If you arrange things correctly, it will all work out
right---which was what you were asking for. Change your HTML
form to contain HTML code like this:
<input type=checkbox name='h04' value=' CHECKED '>
Now when the user checks the checkbox, $FORM{'h04'}
will automatically contain the value you want,
CHECKED. Then to print out your report, you just say:
print "Box 4: $FORM{h04}";
You no longer need the extra variables, because the form
variables get the correct values in the first place.
No else required.
--
Mark Dominus
Perl Paraphernalia
| [reply] [d/l] [select] |