Welcome Guest ( Log In | Register )

Bump Topic Topic Closed RSS Feed

Outline · [ Standard ] · Linear+

 OnChange in classic ASP..., Classic ASP

views
     
TSalesshans
post Nov 6 2009, 09:37 AM, updated 17y ago

Casual
***
Junior Member
303 posts

Joined: May 2005
From: Honky Tonk...


hi...
I would like to create 2 dropdownlist...
1st is Country...2nd is State...
for example...if I choose Malaysia in 1st dropdownlist...
2nd dropdownlist will appear KL, Penang, Kedah....
if I choose USA in 1st dropdownlist...
2nd dropdownlist will appear San Francisco, New York, Chicago....
how i going to make it in ASP classic without reloading the page?...

thanks all... notworthy.gif
silvestrelsl
post Nov 6 2009, 09:45 AM

Getting Started
**
Junior Member
222 posts

Joined: Aug 2009
From: Cyberjaya


AJAX can do the job.
Go google out Javascript + XMLHttpRequest object, you can find tons of info there.
AwaN87
post Nov 6 2009, 12:21 PM

Getting Started
**
Junior Member
272 posts

Joined: Apr 2009
From: KL
I'm sorry but your(silvestrelsl) reply aren't helping him..
Of coz anyone know if they lost or something, definitely google is da way..
but when they find out there is nothing out there, then it is time to ask people..
**u have experience in asp.net, so why not in classic asp..


Back to topic,
here is some of my advice,

on first dropdown, you should set onchange function
that will send 'country' parameters, to the page itself..
as on top of the page u should write

CODE
Dim StrCountry = Trim(Request.Form("txtCountry"))


the onchange function should be:

CODE
function Onchange(){
   document.form.action = "YourPageName.asp"
   document.form.submit();
}

this function should reload the page.. but already hold the StrCountry parameter


So for the 2nd dropdown,
its up to you to use between Select case or some recordset from table
as long as u use the 'StrCountry' as their option on filtering..

i hope diz should help you.. smile.gif
silvestrelsl
post Nov 6 2009, 03:39 PM

Getting Started
**
Junior Member
222 posts

Joined: Aug 2009
From: Cyberjaya


Right, you have your point here.
The stuff like what you had shown him is consider just a basic stuff. I expect he should know it.

QUOTE
how i going to make it in ASP classic without reloading the page?...
Base on his quote, he do not want a postback. The key point I want to tell the TS is AJAX can do what he want. Otherwise, pure javascript also can, but you have to hard code the menu.
TSalesshans
post Nov 6 2009, 08:46 PM

Casual
***
Junior Member
303 posts

Joined: May 2005
From: Honky Tonk...


thanks silvestrelsl and AwaN87...really appreciate it...biggrin.gif

Topic ClosedOptions
 

Change to:
| Lo-Fi Version
0.0136sec    0.49    5 queries    GZIP Disabled
Time is now: 15th December 2025 - 07:25 AM