Jump to content


Photo

drop-down based on criteria


  • Please log in to reply
5 replies to this topic

#1 lional

lional
  • Members
  • PipPipPip
  • Advanced Member
  • 266 posts

Posted 20 July 2006 - 03:14 PM

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

#2 ryanlwh

ryanlwh
  • Staff Alumni
  • Advanced Member
  • 511 posts

Posted 20 July 2006 - 04:34 PM

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.
<select name="category" onChange="document.form1.submit()">

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.
Please use EDIT * 100...
Please use
or [php] * 1000...

PLEASE READ THE POSTED SOLUTIONS CAREFULLY * 1000000...

#3 lional

lional
  • Members
  • PipPipPip
  • Advanced Member
  • 266 posts

Posted 20 July 2006 - 05:29 PM

If somebody turns off javascript o their browser will this ten stop functioning

#4 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 20 July 2006 - 05:50 PM

If somebody turns off javascript o their browser will this ten stop functioning

Yes.

#5 lional

lional
  • Members
  • PipPipPip
  • Advanced Member
  • 266 posts

Posted 20 July 2006 - 06:44 PM

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

#6 ryanlwh

ryanlwh
  • Staff Alumni
  • Advanced Member
  • 511 posts

Posted 20 July 2006 - 08:29 PM

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.
Please use EDIT * 100...
Please use
or [php] * 1000...

PLEASE READ THE POSTED SOLUTIONS CAREFULLY * 1000000...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users