Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] How implement drop-down list box values in asp with javascript-reg


  • From: shawn.milo at gmail.com (Shawn Milo)
  • Subject: [Javascript] How implement drop-down list box values in asp with javascript-reg
  • Date: Mon Jun 27 05:39:45 2005

The way I do this is to create Javascript arrays with ASP during the
page load. Then, in the 'onclick' event of the first two drop-down
boxes, I have code to fill or clear the boxes.

I will e-mail a more complete example once I get to work, where most
of my code is, but here's something to get you started. I did this off
of the top of my head, so it may not my 100% accurate as far as
syntax.

Shawn

Example:

<script type="text/javascript">
   //note -- this Javascript is written by the ASP

   var aColleges = new Array();
   var aDepts = new Array();
   var aEvents = new Array();

   aColleges[aColleges.length] = new Array('1', 'School One');
   aColleges[aColleges.length] = new Array('2', 'University X');
   aColleges[aColleges.length] = new Array('3', 'State College');
   aColleges[aColleges.length] = new Array('4', 'Bigtown College');

   //Note that here, the '1' refers to 'School One, and the
   // 14 refers to the department code
   aDepts[aDepts.length] = new Array('1', '14','Science');
   aDepts[aDepts.length] = new Array('1', '15','Art');
   aDepts[aDepts.length] = new Array('1', '16','History');
   aDepts[aDepts.length] = new Array('2', '17','Computer Science');
   aDepts[aDepts.length] = new Array('2', '19','Biology');
   aDepts[aDepts.length] = new Array('2', '25','Philosophy');
   aDepts[aDepts.length] = new Array('2', '33','Engineering');

   aEvents[aEvents.length] = new Array('17', 'Linux Install-Fest');
   aEvents[aEvents.length] = new Array('15', 'Student Art Exhibit');
   aEvents[aEvents.length] = new Array('25', 'Taoism Lecture);


</script>


Shawn




On 6/27/05, Jai Sankar N <pnjaisan@xxxxxxxxx> wrote:
> Hello sir, 
>   
> I'm a member of javascript mailing list. sir i'm developing website for
> university in tamil nadu, india. 
>   
> Sir, i want to fill three dropdown box (combo box) with dependent one
> another... 
> i.e First Combo box have college list, Second Combo box for department for
> the specifid collge and  Third Combo box fill with research, events,news etc
>  for the specified department. 
>   
> The above is a my problem.. 
>   
> How to implement  using asp and javascrit / vbscript. 
>   
> Pls.  help me.. 
>   
> Jai Sankar N 
> Salem,Tamil Nadu 
> India.
> 
>  ________________________________
> Yahoo! Sports
>  Rekindle the Rivalries. Sign up for Fantasy Football 
> 
> 
> _______________________________________________
> Javascript mailing list
> Javascript@xxxxxxxxxx
> https://lists.LaTech.edu/mailman/listinfo/javascript
> 
> 
> 


-- 
Shawn Milochik

The Freelance Pen
FreelancePen.com
610-621-2648