Forum Moderators: coopster
it should be something like this
//here you get the first box selection
$selectBox1 = $_POST['selectBox1'];
//now here you can create different select boxes dependant on results
if($selectBox1 == 'option1'){
// write a select box here, or store the code for a particular select box here
}
if($selectBox1 == 'option2'){
// write a select box here, or store the code for a particular select box here
}
hope this helps
Ally
Thanks for your solution but i think you did not get me clearly.
I want to create another combo box within the same page depending on selected results before clicking the submit button.
See the HTML for the first combo.
Ministry <select name='ministry' size='1' maxlength='30'>
<option selected value='finance'>Finance </option>
<option value='labour'>Labour </option>
</select>
Thank you.
option 1. write all your select boxes to the page using php, then use javascript to hide and show relevant select boxes. This will achieve what you want but isnt the most elegant way in the world, but it works.
option 2. have some ajax to communicate with the server when you choose from the first drop down list. This will then repopulate the second drop down list with values stored in a DB or predefined vars.
You cant do what you want with php though because the page will require a refresh
Ally