Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms 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 December 17th, 2003, 05:46 AM
Registered User
 
Join Date: Dec 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Combo Box Problem

Hai,
      I am a new memeber.I joined yesterday only.Now I am Learning ASP.I had a small problem.

I had three combo boxes in a row in a page.

The first combo box contains country names that is retrived from the
database.

when i select a country i want to display the corresponding states that is available in the database.
I don't know Java script.
please help me.I need ur valuable suggestions.
please...
Bye

urs
nag







 
Old December 17th, 2003, 02:40 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Not intending to sound terse with this response but it sounds like this is the right time for you to start learning some javascript outside of a forum environment. Sometimes just having forum members throw you answers is not the best thing when you are unfamiliar with the basics. I'd suggest looking thru some javascript tutorials to get started with these basics.

In short, I can provide these suggestions:
You need to handle the select element onchange event to capture when someone makes a choice.

    <select onchange="doCountrySelection(this);">

Your javascript function needs to post the form back to the server. This will entail having the form "action" be set to the page it's on. To post the form with javascript:

function doCountrySelection(objSelector){
    objSelector.form.submit();
}

Then you can capture the selected value in asp: Request("country")
From there you can use that data to select the data for the next drop down. Keep in mind that now you'll need to "preselect" the country that the user chose. If you don't the country selector will default back to the top of the list.

Peter
------------------------------------------------------
Work smarter, not harder.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Combo box to display items from parent combo box Gini Visual Studio 2008 0 June 18th, 2008 12:30 AM
Combo box choice creating filtered combo box stevensj5 Access 11 September 13th, 2007 11:33 AM
Problem with Combo Box ru1 Access 1 October 20th, 2006 06:32 AM
Combo box problem diegoblin Beginning VB 6 2 October 4th, 2006 05:32 PM
Combo Box Problem munrrob Access 1 September 21st, 2006 10:35 AM





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