how can make page continuously refresh (auto-refresh) based on value selected drop down menu? googling, have far. please refer code below.
<form> update interval (in seconds): <select name="interval" id="interval"> <option value="5">10</option> <option value="10">10</option> <option value="15">15</option> <option value="20">20</option> </select> </form> <script type="text/javascript"> window.settimeout('window.location="";', document.getelementbyid('interval').value*1000); </script>
the problem facing right now, page only refreshes in 5 seconds interval (first selection in drop down), no matter value selected. relative new html , javascript, can this.
you need on change of select dropdown, otherwise based on selected value on page load(5 in sample code)
<form> update interval (in seconds): <select name="interval" id="interval" onchange="window.settimeout(function(){ document.location.reload(true); }, this.options[this.selectedindex].value*1000);"> <option value="" disabled selected>make selection</option> <option value="5">5</option> <option value="10">10</option> <option value="15">15</option> <option value="20">20</option> </select> </form>
Comments
Post a Comment