F
Fernie
Today, I began experimenting with an 'options menu':
<SELECT name="CHOICES">
<OPTION>YES</OPTION>
<OPTION>NO</OPTION>
<OPTION selected>MAYBE</OPTION>
It took me a while to figure out how to set and read values. I've got it
working but I am surprised an how cumbersome my solution is and I'd like to
know if I took the wrong approach.
TO PROGRAMATICALLY READ A USER SELECTED ITEM:
My cgi reads the selected value of the 'CHOICES' control. This is easy and
makes sense.
TO PROGRAMATICALLY SELECT AN ITEM TO DISPLAY:
Now for the cumbersome part. My cgi must insert the text 'selected' next to
the option that I wish to select when displayed. To me, it makes more sense
to assign a value to CHOICES instead. Am I missing something obvious here?
I am guessing that web development environments such as PHP, Perl, and
others have built in routines to make the handling of 'option menus' simpler
than having to modify the html yourself. Is this correct?
Thank you,
Fernie
<SELECT name="CHOICES">
<OPTION>YES</OPTION>
<OPTION>NO</OPTION>
<OPTION selected>MAYBE</OPTION>
It took me a while to figure out how to set and read values. I've got it
working but I am surprised an how cumbersome my solution is and I'd like to
know if I took the wrong approach.
TO PROGRAMATICALLY READ A USER SELECTED ITEM:
My cgi reads the selected value of the 'CHOICES' control. This is easy and
makes sense.
TO PROGRAMATICALLY SELECT AN ITEM TO DISPLAY:
Now for the cumbersome part. My cgi must insert the text 'selected' next to
the option that I wish to select when displayed. To me, it makes more sense
to assign a value to CHOICES instead. Am I missing something obvious here?
I am guessing that web development environments such as PHP, Perl, and
others have built in routines to make the handling of 'option menus' simpler
than having to modify the html yourself. Is this correct?
Thank you,
Fernie