Dependant drop down list - without posting back

bizzydint

Well-known member
Joined
Apr 8, 2003
Messages
75
Ive got one drop down list containing regions across the country (North West, South East etc) - then a second drop down to contain the counties/cities within that region.

All the data is stored in a database. I dont want to have to post back and have been reading a few articles saying that I should use javascript to preload all the possibilities for the 2 list.

BUT - all the code samples Ive found are in ASP not .net and Im having trouble getting to grips with how this should be working.

Can anyone lend a hand?
cheers,
van
 
There is nothing to do with ASP or ASP.NET, because you just need HTML and Javascript to do it.

I did posted the sample of the source in this forum, you can search for it.
 
But the data is coming out of a database - I *dont* want to hard code a javascript array with all the possibilities (in total there are over 200 and these might change with time)

any other suggestions?
:)
 
You can use ASP or ASP.NET to generate your javascript array and pass to client site. You never do that? It is quite common in ASP.
 
Something like this:

Code:
<%
  AspArray = "new Array(...)"
%>

<script>
   array = <%=AspArray%>
</script>

Do you get what I mean?
 
Back
Top