
choice.php
<html> <head> </head> <body> <form id="choice" action="index.php" method="post"> <script type = "text/javascript"> function NewList(selObj,newObj,addObj) { var selElem = document.getElementById(selObj); var selIndex = selElem.selectedIndex; var newElem = document.getElementById(newObj); var tmp = ''; newElem.options.length = 0; for (var i=0; i<selElem.options.length; i++) { tmp = selElem.options[i].value; if (i != selIndex) { newElem.options[newElem.options.length] = new Option(tmp,tmp); } } } function submit() { var message = "Your selections were:- "; if ((document.getElementById("SBox0").value != "Select A Fruit") && (document.getElementById("SBox1").value != "Select A Fruit") && (document.getElementById("SBox2").value != "Select A Fruit") ) { message += document.getElementById("Sbox0").value + " "; message += document.getElementById("Sbox1").value + " "; message += document.getElementById("Sbox2").value; } else {message = "You must make a selection from all three lists"} alert (message); } </script> FIRST CHOICE <select id="SBox0" onchange="NewList('SBox0','SBox1','AddedOptions')"> <option value ="Select A Fruit">Select A Fruit </option> <option value="Apple">Apple</option> <option value="Orange">Orange</option> <option value="Mango">Mango</option> </select> SECOND CHOICE <select id="SBox1" onchange="NewList('SBox1','SBox2','')"> <option value=""></option> </select> THIRD CHOICE <select id="SBox2"> <option value=""></option> </select>     <input type = "submit" value = "Submit" onclick = "submit()"> </body> </html>
index.php
<?php $SBox0 = $_POST['SBox0']; $SBox1 = $_POST['SBox1']; $SBox2 = $_POST['SBox2']; if($SBox0 and $SBox1 and $SBox2 ) { } ?>