html - PHP Auto update selectbox based on 1st selectbox -


i have 2 selectboxes

 <h3>results</h3>     <select id="register_form" name="sport" />     <option value="rugby">rugby</option>     <option value="cricket">cricket</option>     <option value="football">football</option>     </select>        <?php     echo'<select name="match">';     echo'<option value="'.$row['event_id'].'">'.$row['team1'].' vs '.$row['team2'].'</option>';     echo'</select>';    ?>     <input id="register_form" type="submit" value="display" name="submit" /> 

user searches result by:

selecting sport type in 1st selectbox , in 2nd selectbox option values populated based on sport type.

is possible in php without user having first press submit $_post value of sport type?

what best option here?

1.ajax option asked that(without page refresh)

  1. when use php it's possible page refresh. ajax without page refresh it's possible.

  2. helping links are:-

use jquery change second select list based on first select list option

https://www.daniweb.com/web-development/php/threads/372228/php-and-ajax-auto-populate-select-box

https://remysharp.com/2007/01/20/auto-populating-select-boxes-using-jquery-ajax


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -