rlb_wpg
Apr 6th, 2001, 01:19 PM
I'm brand new to asp so bear with me.
I have an asp page with a text box, a pulldown list and a 'submit' button.
I'd like to set session values using the submit button without going to another file.
For example,
...
<HEAD><SCRIPT LANGUAGE="JavaScript"><!-- Begin
function SubmitInfo() {
var msg
<%
Session("Name")=request("Name")
Session("UseDb")= request("useDB")
msg = session("UseDb")
%>
window.alert("Database selected: " + msg);
}
// End --></SCRIPT></HEAD>
...
<form name="EnterInfo">
<B>Name:  </B><input type="text" name="name" size=8><BR>
<SELECT NAME="UseDb" STYLE="Height: 24px; Width: 75px">
<OPTION VALUE="SwitchDbCops2">Cops 2
<OPTION VALUE="SwitchDbCops1">Cops 1
</SELECT>
<input type="submit" value="Save Info" onClick="SubmitInfo();">
</form>
...
The above does not work (I assume because it can't request itself).
Does anyone know how I could modify this so it could work.
Either Javascript or VBscript is fine with me.
Thanks in advance,
rlb_wpg
I have an asp page with a text box, a pulldown list and a 'submit' button.
I'd like to set session values using the submit button without going to another file.
For example,
...
<HEAD><SCRIPT LANGUAGE="JavaScript"><!-- Begin
function SubmitInfo() {
var msg
<%
Session("Name")=request("Name")
Session("UseDb")= request("useDB")
msg = session("UseDb")
%>
window.alert("Database selected: " + msg);
}
// End --></SCRIPT></HEAD>
...
<form name="EnterInfo">
<B>Name:  </B><input type="text" name="name" size=8><BR>
<SELECT NAME="UseDb" STYLE="Height: 24px; Width: 75px">
<OPTION VALUE="SwitchDbCops2">Cops 2
<OPTION VALUE="SwitchDbCops1">Cops 1
</SELECT>
<input type="submit" value="Save Info" onClick="SubmitInfo();">
</form>
...
The above does not work (I assume because it can't request itself).
Does anyone know how I could modify this so it could work.
Either Javascript or VBscript is fine with me.
Thanks in advance,
rlb_wpg