Wrox Programmer Forums
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old February 6th, 2007, 01:33 AM
Authorized User
Join Date: Dec 2006
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts
Default Drop down list


I have two drop down list in ASP Page.
Eg. country and city
intially, country dropdown list is populated and city dropdownlist doesnt have any value. Once i select country in the onchange event i triggered to submit the page and city is populated with the relevant data but country got refreshed and now able to hold/retain the SELECTED value of the country.

Note: All datas are taken from SQLSERVER 2000 database.
To retain the value is anything to be done in javascript.
Pls help in this which is more critical for me.

Thanks in advance.

Old February 6th, 2007, 02:37 PM
Friend of Wrox
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts

When the submit is being handled, you are using the value from the Country dropdown to retrieve the cites for that country. You can use that same country value to set the "SELECTED" attribute of the option that the user has selected. This will make it display as being the seelcted country.

I assume you are using a loop to populate the country dropdown. Now you will have to check for each country if it is the seleted one, and give it the SELECTED attribute.

Woody Z

Similar Threads
Thread Thread Starter Forum Replies Last Post
drop down list ashu_gupta75 Excel VBA 1 October 15th, 2007 05:52 PM
drop down list values based on another drop down noor ASP.NET 1.0 and 1.1 Basics 3 July 5th, 2005 09:57 AM
Drop Down List mrideout BOOK: Beginning ASP.NET 1.0 6 March 18th, 2005 03:32 AM
Drop Down List mrideout BOOK: Beginning ASP.NET 1.0 8 September 16th, 2004 07:11 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.