Client Side + Server Side Scripts 
Author Message
 Client Side + Server Side Scripts

Client Side + Server Side Scripts

Hi All
I got 2 tables

Groups, Employees

and on my web page there will be 2 lists
the first is for all the groups
the second is for the employees belonging to the selected group (When the
user will select a group from the list)

to accomplish this I think there will be <Client side script> and a <Server
side script>

the client side script (JScript is a preference) will be executed when the
"Groups List" onChange Event is fired... to populate the "employees list"
with employees corresonding to the selected Group only

can someone tell me if such a thing is accomplished and if possible How can
it be accomplished?

--
"Minds are like parachutes - they only function when open."
- Thomas Dewar



Mon, 11 Aug 2003 22:45:57 GMT  
 Client Side + Server Side Scripts
You can do this one of two ways:
1) Load all the employees into javscript arrays when you load the page and use
the 'new Option' constructor to populate the Employees select menu.
2) Use remote scripting to query the database and fill the select menu on the fly
using the 'new Option' constructor. You can find out more about remote scripting
at http://msdn.microsoft.com/scripting/
The only diffence is how you want to fill the array that has the options.

Here's a basic script:
var E1Array[2];
E1Array[0] = "Don Johnson";
E1Array[1] = "Phillip Micheal Thomas";
E1Array[2] = "Sandra Santiago";
document.form1.Employees.options.length = 0; //clear the select menu
for (i = 0; i <E1Array.length ;i++){
document.form1.Employees.option[i]=new Option(E1Array[i],E1Array[i],false,false);

Quote:
}

Have fun!
Erick


Tue, 12 Aug 2003 00:04:12 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Client Side + Server Side Scripts

2. Client side scripting / server side scripting

3. Accessing Data generated with client-side script from server-side script

4. Calling Server Side Script from Client Side Script

5. Call Server Side Script From Client Side Script

6. Client side scripting / server side scripting

7. ASP referring to server side variables in client side script

8. Client side and Server side script working together

9. Client Side and Server Side Scripts

10. Server Side writing Client Side scripts

11. Passing Server Side Arrays to Client Side Scripts

12. Mixing of client-side and server-side scripts

 

 
Powered by phpBB® Forum Software