![]() |
|
#1
|
|||
|
|||
PHP - FormOkay so I've looked all around on Google and can't find what I'm looking for...check this out ->
I have a standard HTML form where users enter information blah blah blah, and one of these inputs is a drop down menu of all the states. SO that information is sent to a php page that accepts the information, it basically ensures that people didn't forget to fill required fields in, aren't injecting code, and a few more things. If there are any problems it will flag the errors and set headers for the previous page. All the information that was submitted the first time is sent back into the forms so that users don't have to enter it all in again. THE QUESTION: How do I send back information to the state DROPDOWN input? I know that you would use selected as such: <option value="OH" selected="selected">OHIO</option> BUT, what is the best way to take the value (OH) and use it to select Ohio from the dropdown menu. Should I just do a php if statement for each option, or is there a better option? This is my idea right now: PHP Code:
|
|||
|
#2
|
||||
|
||||
Re: PHP - FormPerhaps something like this:
PHP Code:
|
|
#3
|
|||
|
|||
Re: PHP - FormThanks Mr. Admin
That looks like it's going to do the trick, I'll pop it in when I get back. Now I'm wondering how people achieve real time error checking on forms (ex Facebook)... Is that done with JScript or another lang? Does anyone know where I might find a script to that will bring out an error box (or even just text) to the side if the password (username, etc) doesn't meet criteria?Thanks, Crazygol4 |
|
#4
|
||||
|
||||
Re: PHP - FormYes, a client-side script is something you will need to achieve "real time error checking on forms". The most popular of which is Java Script.
Unfortunately, I am cannot help you with the example JS codes you requested -- I am the world's worst Java Script coder Try starting a new discussion in the Web Development Forum, maybe a kind and helpful member will pick it up. |
|
#5
|
|||
|
|||
Re: PHP - FormSure enough. Thanks again for all the help!
|
Recent GIDBlog
Once again, no time for hobbies by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| HTML Form to PHP File - Help Requested | vigilantweather | MySQL / PHP Forum | 15 | 07-Aug-2006 20:22 |
| Flash login form and PHP | Error | MySQL / PHP Forum | 2 | 14-Nov-2005 19:38 |
| PHP form needs validation | jabesign | MySQL / PHP Forum | 16 | 05-Jan-2005 01:23 |
| Php Form....help | spyko05 | MySQL / PHP Forum | 0 | 12-Nov-2003 12:00 |
| Automate a data change php form | mjfmn | MySQL / PHP Forum | 4 | 20-Oct-2003 10:37 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The