How to process a
Problems. For the last couple of days I've been covering a lot of
ground on a DSL connection in multiple search engines trying to find
out how to process a <select multiple... style form element, and I'm
at the end of my rope. If anyone has a URL that shows how to do
this, please post it, or *make one* for the world. It should be as
simple as possible, nothing fancy. I should be able to adapt it then
for a search engine I wrote, which right now is just using a
non-elegant approach using checkboxes to select which years out of a
collection of archive files to search.
By far the best route would be a working form that also shows the
cgi/perl script, and will return on submit some simple response like:
Not selected: 1998
So the form is something like this:
<FORM action="http://somesite.com/cgi-bin/prog.cgi" method="post">
<SELECT multiple name="multiselect">
<OPTION selected value="2000">2000</OPTION>
<OPTION selected value="1999">1999</OPTION>
<INPUT type="submit" value="Submit"><INPUT type="reset"
...and the script would contain a 'foreach' loop I suppose, checking
for the existence of each array item? Optionally you could leave out
the 'Not selected' part, and only print 'Selected' for those that
are, ignoring those that are not selected.
I would *greatly* appreciate seeing this at its simplest!