Solved

Make Div tags work like frames

Posted on 2011-03-14
2
498 Views
Last Modified: 2012-06-27
I am trying to write an app that gives me the basic functionality of a frame by using divs.

What I would like to do is have an initial drop down to select a major catagory and then in another div, have it display the options for the sub category.

Example
select state
      -> select city in the above state

I only want to see the cities from the above state and to make it even more difficult,  it needs to be dynamic because the cities can change.  This is part of a delivery tracking app.


0
Comment
Question by:ISHUC
2 Comments
 
LVL 8

Accepted Solution

by:
imantas earned 250 total points
ID: 35130007
I think what you need is AJAX. It will let you receive data from the server withouth refreshing the whole page and put it inside any place on the page. There's no other way than JavaScript to update contents of a div. Usually JavaScript frameworks like jQuery have a very friendly interface which makes it very easy to use.

You can find more info here.
0
 
LVL 6

Assisted Solution

by:blueghozt
blueghozt earned 250 total points
ID: 35136443
This example gives you all the code you need for the current city/state relationships http://www.bitrepository.com/dynamic-dependant-dropdown-list-us-states-counties.html

If you want to make the cities dynamic (how often do they really change?) then you will need to subscribe to some sort of web service that maintains all of this information, I don't know of any US ones as I am UK based (we have Royal Mail’s PAF data that is updated regularly) but I am sure they are out there. The above example should get you up and running though.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SlickNav Menu Plugin Not appearing on mobile 6 31
jquery datepciker end date add 6 days 6 34
send post values 7 26
alert(innerHTML); 7 10
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 …
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

776 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