Dynamic forms

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
wescrock
Forum Commoner
Posts: 31
Joined: Wed Sep 10, 2008 10:31 am
Location: Fresno, CA

Dynamic forms

Post by wescrock »

Hello all,

I was hoping that maybe someone could show me an example of how to make a form change based on a selected option in a select statement.

here is my select statement:
<select name="fair_name">
<?php
while ($row = mysql_fetch_assoc($result_fair_name)){
$id_fair_ = $row['id_fair_'];
$fair_name = $row['fair_name'];
print "<option value=$id_fair_>$fair_name\n";
}?>
</select>
When the option 'General Worlds Fair' is selected... I need a second select statement to appear... If else, i need an input for year and place help to appear.

If anyone could help, that would be phenomenal!

thank you,
Wes
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: Dynamic forms

Post by aceconcepts »

If you dont want to actualy have to post any data for this to happen then you will have to use JavaScript - i think they call it a chain select: http://www.google.co.uk/search?hl=en&q= ... arch&meta=
Post Reply