|
#1
|
|||
|
|||
|
Hey
How would you validate a drop down menu using PHP. I know how to do it with Javascript Cheers Tom Evans Last edited by gold2040; 05-30-2006 at 02:30 PM. |
|
#2
|
||||
|
||||
|
Assuming your dropdown is named "dropdown" and the form's method is "post"...
PHP Code:
Lots can be done to verify.... At least that's a basic example. php.net has lot of info about various php things if you want to learn... look up "form handling"...
__________________
Daniel - <?php?> | <html>| Ich lerne Deutsch. | Studio l'italiano. | Estudiaba español. | Estudo português. | 日本語の勉強。| मैं हिन्दी सीखो | درس العربية |
|
#3
|
|||
|
|||
|
Hey
Cheers for that. I mean like you just have to select 1 option out the dropdown menu Tom Evans |
|
#4
|
||||
|
||||
|
Well... hate to point out the obvious... but it's worthless to have a dropdown menu "choice" if one is required... it's like an election with one candidate
![]() Anyway... the above will do what you want. Just for the "do stuff" make it continue in your script, and for else use, maybe, die("error. please try again."); die() stops the page from loading at that point and outputs the string in the parentheses. You can use html in there too, like a JS-based back link. that's the basics... not sure what funtionality you want if it's right or if it's wrong.
__________________
Daniel - <?php?> | <html>| Ich lerne Deutsch. | Studio l'italiano. | Estudiaba español. | Estudo português. | 日本語の勉強。| मैं हिन्दी सीखो | درس العربية |
|
#5
|
||||
|
||||
|
Quote:
We've had those for decades.
__________________
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP! |
|
#6
|
||||
|
||||
|
quite true.
also, I'm guessing this might be related to "do you accept these terms: yes/no", in which case it's totally valid. still worth pointing out, though
__________________
Daniel - <?php?> | <html>| Ich lerne Deutsch. | Studio l'italiano. | Estudiaba español. | Estudo português. | 日本語の勉強。| मैं हिन्दी सीखो | درس العربية |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
|
|