Requiring a selection on a dropdown list?

R

Ron

Maybe more of an html question but here goes. I have a form with a
drop-down list I would like to require the user to make a selection on. How
would I go about doing this?

Thanks,
Ron
 
E

Eric Schwartz

Ron said:
Maybe more of an html question but here goes.

More like CGI, really. You want comp.infosystems.www.authoring.cgi,
over --> thataway.
I have a form with a drop-down list I would like to require the user
to make a selection on. How would I go about doing this?

Print the form again, with an error message, if they don't make a
selection. See the aforementioned CGI group for more details.

-=Eric
 
D

dan baker

Ron said:
Maybe more of an html question but here goes. I have a form with a
drop-down list I would like to require the user to make a selection on. How
would I go about doing this?
-----------

well, the cgi group IS more in line with this, but if you are sending
the form to a perl script... you just have to check the contents of
the parameter, and send the user an error message or back to where
they came from...

use CGI qw( param );
my $FilePath = param( 'FilePath' );
unless ( $FilePath ) {

print "Content-type: text/plain \n\n".
"you need to make a selection for FilePath...\n" ;
}

remember that checking with javascript on the webpage is ok, but wont
protect you from anyone TRYING to send bad stuff as they can write a
script to feed your script whatever they want. You HAVE to check it
server-side.

d
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,781
Messages
2,569,615
Members
45,299
Latest member
JewelDeLaC

Latest Threads

Top