Web Development Question (filtering) As part of the site im building a user has the option to filter to only show a certain catagory eg. "Oustanding Issues" or "Resolved Isses" etc. Now, I've coded this in PHP, whereby it takes the value currently set in a list/menu and selects the certain records based on the if statements. Now....in dreamweaver I have the default set to "Outstanding Calls" - at the minute when i alter the menu option, nothing happens...which is expected since i have not coded this yet. My question is...firstly...how do i force a page refresh when you choose a new optiona and secondly...and indeed more importantly...how do i get the page to remember that the option has been changed and only display the corresponding records? Could I perhaps have a "Go" link or whatever, which will then refresh the page...passing a value into the URL which is then taken up in the code? At the minute, it works if i manually alter the default value for the list/menu. Slightly stumped!! Input appreciated
Re: Web Development Question (filtering) javascript will do it automatically, submitting the form to itself will do it at the click of a button
as i said you can submit the form to itself... but you need to trigger it by javascript or a button. you dont have all the asp short cuts, which remove the fun and the understanding from coding
pass it in the query string or as a hidden variable in the form. <input type="hidden" name="var1" value="$choice"> or page.php?var1=$choice depending how you refresh the page.
well i've only gone and cracked it at last! <select name="filter" id="filter" onchange="location.href=filter.options[selectedIndex].value"> <option selected="selected">Issue Filter...</option> <option value="userhome.php?filter_id=1" >All Issues</option> <option value="userhome.php?filter_id=2" >Outstanding Issues</option> <option value="userhome.php?filter_id=3" >Resolved Issues</option> </select> Glorious.