lional Posted July 20, 2006 Share Posted July 20, 2006 Hi AllI would like to write a little application where people enter their details in a catagory and a sub-category.They then enter their state/province as well as their city.What I want to write is to have two drop-down boxes, one with the state/province and another one with the city.It must only show the state/province for the selected category and sub-category, and it in turn must only how the cities for the state/province that has been selected.Can anyone give me some adviceThanksLional Quote Link to comment https://forums.phpfreaks.com/topic/15155-drop-down-based-on-criteria/ Share on other sites More sharing options...
ryanlwh Posted July 20, 2006 Share Posted July 20, 2006 you can use javascript to auto submit the form once the user selected a category and subcategory. when you have those information, then you will be able to query for the state/province info, and so on.[code]<select name="category" onChange="document.form1.submit()">[/code]just keep in mind that if you use this function you don't want to name one of your buttons "submit". this would confuse the browser. Quote Link to comment https://forums.phpfreaks.com/topic/15155-drop-down-based-on-criteria/#findComment-61126 Share on other sites More sharing options...
lional Posted July 20, 2006 Author Share Posted July 20, 2006 If somebody turns off javascript o their browser will this ten stop functioning Quote Link to comment https://forums.phpfreaks.com/topic/15155-drop-down-based-on-criteria/#findComment-61179 Share on other sites More sharing options...
zq29 Posted July 20, 2006 Share Posted July 20, 2006 [quote author=lional link=topic=101254.msg400611#msg400611 date=1153416583]If somebody turns off javascript o their browser will this ten stop functioning[/quote]Yes. Quote Link to comment https://forums.phpfreaks.com/topic/15155-drop-down-based-on-criteria/#findComment-61192 Share on other sites More sharing options...
lional Posted July 20, 2006 Author Share Posted July 20, 2006 Is there another solution without using javascript.Let me explain the structure how it runs si far.1) the user selects the category and subcategory and submits it to a page. If there are more than 6 listings on the new page the user can then streamline their search by entering the state/province. I would however only like to show the cities that are applicable to a state/proince but this must work everytime so I do not think that javascript is an option Quote Link to comment https://forums.phpfreaks.com/topic/15155-drop-down-based-on-criteria/#findComment-61221 Share on other sites More sharing options...
ryanlwh Posted July 20, 2006 Share Posted July 20, 2006 well if you split them into different pages (steps) then you don't have to worry about javascripts. just have them click on submit after categories. Quote Link to comment https://forums.phpfreaks.com/topic/15155-drop-down-based-on-criteria/#findComment-61302 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.