|
 |
asp_web_howto thread: ASP and JavaScript onChange() event
Message #1 by "Inge Wynants" <inge.wynants@m...> on Sun, 28 Jan 2001 13:16:07 -0800
|
|
Hi,
I have an asp page that contains a select combobox. I want to pass the selected value to another asp page. How can I do that with
the Javascript onChange() event?
Here is my code:
<%
dim objSub
set objSub = objConn.Execute("SELECT RS_ID_ID, RS_Address, Alias FROM Subscription S, Client C WHERE S.Client_Number =
C.Client_Number ORDER BY RS_Address")
do until objSub.EOF
ID = ID & "<option value=" & objSub("RS_ID") & ">" & objSub
("RS_Address") & " " & objSub("Alias") & "</option>"
objSub.movenext
loop
%>
<table width='100%' height='100'>
<form name='SubForm' method='post'>
<tr><td align='center' valign='middle'>
<select name='Subscription' onChange="JavaScript:parent.rechts.location.href='terminal.asp?ID=' +
this.options[this.selectedIndex].value + ';">
<option value='0' selected>SELECT TERMINAL</option>
<%= ID%>
</select></td></tr>
</form>
</table>
Thanks
------------------------------------------------------------
Want a free mail at http://www.mail.be ?
Message #2 by dont worry <aspmailbox@y...> on Mon, 29 Jan 2001 09:16:51 -0800 (PST)
|
|
Have the onchange event SUBMIT the value to the next
page.
--- Inge Wynants <inge.wynants@m...> wrote:
> Hi,
>
> I have an asp page that contains a select combobox.
> I want to pass the selected value to another asp
> page. How can I do that with the Javascript
> onChange() event?
>
> Here is my code:
> <%
> dim objSub
> set objSub = objConn.Execute("SELECT RS_ID_ID,
> RS_Address, Alias FROM Subscription S, Client C
> WHERE S.Client_Number = C.Client_Number ORDER BY
> RS_Address")
>
> do until objSub.EOF
> ID = ID & "<option value=" & objSub("RS_ID") & ">"
> & objSub
> ("RS_Address") & " " & objSub("Alias") &
> "</option>"
> objSub.movenext
> loop
> %>
>
> <table width='100%' height='100'>
> <form name='SubForm' method='post'>
> <tr><td align='center' valign='middle'>
> <select name='Subscription'
>
onChange="JavaScript:parent.rechts.location.href='terminal.asp?ID='
> + this.options[this.selectedIndex].value + ';">
> <option value='0' selected>SELECT TERMINAL</option>
> <%= ID%>
> </select></td></tr>
> </form>
> </table>
>
> Thanks
>
>
>
>
|
|
 |