Hello! I heed a script. It should refresh a form after a user pick a value (so next options list will depend on what value user picked b4). Thank you!
yeah this is how i want this form to work this is what i need - www(dot)kroon-oil(dot)com/uk/products/productrecommendation(dot)php I never worked with JavaScript b4, so might be hard for me :/ And i need script to take info from database (i am using PHP). Here is full code of that page: <?php require($_SERVER["DOCUMENT_ROOT"]."/xenum/config/db_config.php"); $connection = mysql_connect($db_host, $db_user, $db_password); if(!$connection){ die(mysql_error()); } $selectDb = mysql_select_db($db_name, $connection); if(!$selectDb){ die(mysql_error()); } ?> <html> <head> <title></title> </head> <body bgcolor="black"> <div align="center"> <table> <tr> <td><img src="images/image_03.jpg"></td> </tr> <tr> <td> <!--Main Table--> <table border="0" cellspacing="0" cellpadding="0" background="images/image_05.jpg" width="964" height="527"> <tr> <td> <table border="0" width="100%" height="100%"> <form method="post" action="<?php echo $_SERVER[PHP_SELF]; ?>"> <tr height="20%"> <td width="25%"></td> <td width="25%"><font color="#ff6600"><h3>1</h3>Выберите тип автомобилÑ: </font></td> <td width="50%"><br><br><select class="mini" name="cat"> <option class="mini" value="">...........................................................................</option> <?php $query = "SELECT cat FROM cars"; $result = mysql_query($query, $connection); $i = 0; while($row = mysql_fetch_assoc($result)) { $i++; echo "<option class='mini' value='$i'>".$row['cat']."</option>"; } $cat = $_POST['cat']; ?> </select> </td> </tr> <tr height="20%"> <td width="25%"></td> <td width="25%"><font color="#ff6600"><h3>2</h3>Выберите марку автомобилÑ: </font></td> <td width="50%"><br><br><select class="mini" name="make"> <option class="mini" value="">...........................................................................</option> <?php $query = "SELECT make FROM cars WHERE cat = $cat"; $result = mysql_query($query, $connection); $i = 0; while($row = mysql_fetch_assoc($result)) { $i++; echo "<option class='mini' value='$i'>".$row['make']."</option>"; } $make = $_POST['make']; ?> </select></td> </tr> <tr height="20%"> <td width="25%"></td> <td width="25%"><font color="#ff6600"><h3>3</h3>Выберите модель автомобилÑ: </font></td> <td width="50%"><br><br><select class="mini" name="model"> <option class="mini" value="">...........................................................................</option> <?php $query = "SELECT model FROM cars WHERE make = $make"; $result = mysql_query($query, $connection); $i = 0; while($row = mysql_fetch_assoc($result)) { $i++; echo "<option class='mini' value='$i'>".$row['model']."</option>"; } $model = $_POST['model']; ?> </select></td> </tr> <tr height="20%"> <td width="25%"></td> <td width="25%"><font color="#ff6600"><h3>4</h3>Выберите автомобилÑ: </font></td> <td width="50%"><br><br><select class="mini" name="type"> <option class="mini" value="">...........................................................................</option> <?php $query = "SELECT type FROM cars WHERE model = $model"; $result = mysql_query($query, $connection); $i = 0; while($row = mysql_fetch_assoc($result)) { $i++; echo "<option class='mini' value='$i'>".$row['type']."</option>"; } ?> </select></td> </tr> <tr height="20%"> <td width="25%"></td> <td width="25%"></td> <td width="50%"><input type="submit" value="OK"></td> </tr> </form> </table> </td> </tr> </table> <!--End's--> </td> </tr> <tr> <td><img src="images/image_06.jpg"></td> </tr> </table> </div> </body> </html> PHP: So Need to use this JavaScript to work as on that website :/
And how are those scripts? Country State Drop Down - http://javascriptbank.com/javascript/run-script-country-state-drop-down.html SelVal - http://javascriptbank.com/javascript/run-script-selval.html .... http://javascriptbank.com/javascript/form-javascript.html
Yeah this might work but again i never worked with JavaScript, so can anyone show an example how i can use this. Thanks
Yeah this might work but again i never worked with JavaScript, so can anyone show an example how i can use this. Thanks
well. I now use "get" It all works, but is there way to make an option link. So for example if user press option it will go to link index.php?cat=1 if there is way, i think that is what i need
Hmm still i might need JavaScript to make that :/ So can anyone help to install the JavaScript script?