Are you trying to do this with client-side JavaScript or with ASP since the
page submits to itself and you can determine it then?
Chris Tifer
----- Original Message -----
From: "LeGrand Decius" <[EMAIL PROTECTED]>
To: "ActiveServerPages" <[EMAIL PROTECTED]>
Sent: Friday, November 01, 2002 11:54 AM
Subject: set listbox value selected
> Below I have a sample page with a listbox that submits to itself.
> How can I set the default selected value based on the previous selection?
> =================================================
> <html>
> <head>
> <title>Test</title>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> <SCRIPT language=JavaScript>
> function getSelectedIndices (){
> var comboValue
> var selIndex = document.form1.selReports.selectedIndex;
> document.form1.sindex.value = selIndex;
> }
> </SCRIPT>
>
> </head>
>
> <body bgcolor="#FFFFFF" text="#000000">
> <form name="form1" method="post" action="Default_listbox.htm">
> <p><select name="selReports" onChange="getSelectedIndices()">
> <option value="0">Available Reports</option>
> <option value="1">My Reports</option>
> <option value="2">All Reports</option>
> </select>
> </p>
> <p>
> <input type="submit" name="Submit" value="Submit">
> <input type="hidden" name="sindex">
> </p>
> </form>
> </body>
> </html>
>
>
>
> ---
> You are currently subscribed to activeserverpages as: [EMAIL PROTECTED]
> To unsubscribe send a blank email to
%%email.unsub%%
>
---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]