Jump to content

Archived

This topic is now archived and is closed to further replies.

lional

drop-down based on criteria

Recommended Posts

Hi All
I 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 advice

Thanks

Lional

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
If somebody turns off javascript o their browser will this ten stop functioning

Share this post


Link to post
Share on other sites
[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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.