View Full Version : Change a form based on previous input

05-07-2009, 01:59 AM
I was wondering if it's possible in PHP to make it so that once a user selects a certain option in a list, it makes the next input for that form change to either a textfield or a list without losing the values entered in the inputs above.

I know PHP is a server-side script, does that make this not possible?


05-07-2009, 02:11 AM

Yes, with server-side languages, it should be impossible to do that.
What you need is javascript. If you also need to do something with the server in the form you can combine javascript and php with ajax. If you post this on the ajax forum, you should get more results.