


It is the same code I have been trying so far and it is as follows:ĭocument.getElementById(“report_filter”).submit() I used the code which I have been trying to use in the page I am working on, in a separate PHP page and I ran it. But I will tell you the thing I tried recently. Please let me know if you have any questions. Just letting you know this, so that you can have a better picture of this page. Can you let me know what I am doing wrong here?Īlso this page is an authenticated page, like it appears after user logs in with their username/pwd. This is how the form and select statements look like, and this dropdown is in a table cell:Īnd for trial purposes, I want to see if the option that I selected is being echoed as:īut the page remains still once I select an option. I found out from forums that the parameter: “onchange=“document.getElementById(“env”).submit() ”>”, added with the will do the trick.īut when I select an option from the drop down box, the page stays still. I was actually trying to do this without a submit button, in such a way that selecting the filter option from the dropdown box will automatically refresh the page with the queries I want.

This is faster ('ray!) but is more complicated (boo!) and relies on JS (boo!) and that there is no latency on the line. – which is to do 2 above - but use Ajax to bring back the correct data so the page does not refresh entirely. Probably best if you have many thousands of options. Html/PHP where on detecting a change in the state of drop list one, you wait (boo!) while the form is submitted (possibly using js, boo!) and then the page refreshes (boo!) showing the next chained options. Great if you do not have too many options.

Pick a “From airport” and the “To airport” is populated dynamically, and almost instantaneously - its fast ('ray!), relies on JS (boo!) and does not require trips back to the server (('ray!). This is how many of the airline sites manage it. Pure JS - where you load up into JS arrays all the options. One term that you can search on to find advice on this is “chained drop down php”, that should get you some tutorials.Įssentially though there are 2 main ways of achieving this: assign a network inside the option tag/ While($model = mysql_fetch_array($phones2)) $phones2 = mysql_query(“SELECT DISTINCT model FROM phones WHERE country_network LIKE ‘$network_block’”) or die(mysql_error()) The first PDM works great, the second PDM DOESN’T WORK. The first PDM is ‘network’ and the second is phone ‘brand’. The table is composed of: item_id, brand, model, country_network, price, information. I want the user to select x data from the first pull-down menu, and depending on what is chosen, the choices will be reduced on the second pull down menu. I am trying to develop a code with 2 pull-down-menus (PDM).
