Go Premium for a chance to win a PS4. Enter to Win


To hide select box and filter

Posted on 2011-09-12
Medium Priority
Last Modified: 2012-05-12

I need to have the select box for the city and the filter choices to be hiden and
when the user select a state it should appear with the cities that are in the selected state.


The select church should be hidden unless the user select a city.

Please, take a look at my site

how can I first set the Select city dropdown box to hidden and when the user select a state to be visible I need to the same thing with city and church


Question by:lulu50
  • 2
LVL 34

Accepted Solution

Big Monty earned 1000 total points
ID: 36523888
for populating the dropdowns based upon the selection, check out:


for changing the visibility, just surround the select box with a div tag, set its visibility to hidden, then in the onchange event for the first dropdown, change its visibility to visible
LVL 83

Assisted Solution

leakim971 earned 1000 total points
ID: 36523951
you may use css to hide the city list by default :

#GetCity {

with : <select id="GetCity" name="GetCity" ...

in the callback of your ajax call (currently this may not be clear for you, just take your time to read the links provided) you unhide the list with :
document.getElementByid("getCity").style.visibility = "visible";

Author Closing Comment

ID: 36524251
Thank you

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question