Hi ,
Am a newbie to PHP and have been working with drop down lists.
I have a drop down list with 3 options.
Like i have 3 options available there i.e new/cancel/update.
Now i need to generate another 2-3 drop down lists after selection of either of these options above.
For example if i select update 3 different drop down lists should be generated on the screen.
How should i do this...Please help.
Help with Drop down lists
Moderator: General Moderators
Re: Help with Drop down lists
...
<select name="first" onchange='this.form.submit()'>
<option value="form1">Form1</option>
<option value="form2">Form2</option>
<option value="form3">Form3</option>
</select>
...
Fast and ugly 
<select name="first" onchange='this.form.submit()'>
<option value="form1">Form1</option>
<option value="form2">Form2</option>
<option value="form3">Form3</option>
</select>
...
Code: Select all
<?php
$first = $_POST['first'];
if(!empty($_POST['first']) {
switch($first) {
case "form1":
echo "select 1";
break;
case "form2":
echo "select 2";
break;
case "form3":
echo "select 3";
break;
}
}
?>- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: Help with Drop down lists
If you want to process this via the client-side you could take a look at "chained select menus".
Here's a link: http://www.dynamicdrive.com/dynamicinde ... /index.htm
Here's a link: http://www.dynamicdrive.com/dynamicinde ... /index.htm