Form with php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Max Current
Forum Newbie
Posts: 1
Joined: Thu Aug 24, 2006 12:14 pm

Form with php

Post by Max Current »

Hi guys,

OK I have a form with a drop down menu. I want, with php to say, when a certain option in the list is selected (but not submitted) then a second input form is shown below it.

I assume I would have to use the else function etc but am unsure of the syntax that I would use to compare what is selected in the menu; without anything being submitted?

Thanks,

Max
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

you can't really do this with 'PHP' per se. PHP is a server side language and what you're looking to do is client side. You could submit the form to itself on change of the dropdown menu and then build your next option below. Otherwise you'll need Javascript to create your next option (or Ajax).
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

That isn't really done by php per se. Javascript, yes.

edit: Damn, Burrito and my response sound similar. :)
Post Reply