|
 |
asp_web_howto thread: How to get a client variable and using it in the server script.
Message #1 by "Paula Durán Trejos" <paudurtr@h...> on Wed, 21 Feb 2001 14:57:28
|
|
Hi!!!
I need to display a message box and get the value of the answer of the
user and depending of the answer make some changes in the database, so
it's server script. The code is like that:
if FormatNumber(strCuenta) <> 0 then
%>
<script language="javascript">
intRespuesta = MsgBox("<%=Session("Mensaje_Orden")%>")
</script>
<%
end if
When I have the value of intRespuesta, I need to do something like that
If intRespuesta = 7 then
'...Some procedure which access the database
end if
I appreciate some help...
Paula.
Message #2 by "Alex Shiell, ITS, EC, SE" <alex.shiell@s...> on Wed, 21 Feb 2001 15:22:13 -0000
|
|
Not quite sure what you're asking... do you want to know how to get the
input from the user?
-----Original Message-----
From: Paula Dur=E1n Trejos [mailto:paudurtr@h...]
Sent: Wednesday, February 21, 2001 11:30 PM
To: ASP Web HowTo
Subject: [asp_web_howto] How to get a client variable and using it in
the server script.
Hi!!!
I need to display a message box and get the value of the answer of the
user and depending of the answer make some changes in the database, so
it's server script. The code is like that:
if FormatNumber(strCuenta) <> 0 then
%>
<script language=3D"javascript">
intRespuesta =3D MsgBox("<%=3DSession("Mensaje_Orden")%>")
</script> =09
<%
end if
When I have the value of intRespuesta, I need to do something like that
If intRespuesta =3D 7 then
'...Some procedure which access the database
end if
I appreciate some help...
Paula.
Message #3 by "Paula Durán Trejos" <paudurtr@h...> on Wed, 21 Feb 2001 14:16:37 -0600
|
|
I need to get the value of the msgbox, example: Ok, No, Yes, Cancel... If
the value is Ok, or Yes I need to run a process in the server...
>From: "Alex Shiell, ITS, EC, SE" <alex.shiell@s...>
>Reply-To: "ASP Web HowTo" <asp_web_howto@p...>
>To: "ASP Web HowTo" <asp_web_howto@p...>
>Subject: [asp_web_howto] RE: How to get a client variable and using it in
> the server script.
>Date: Wed, 21 Feb 2001 15:22:13 -0000
>
>Not quite sure what you're asking... do you want to know how to get the
>input from the user?
>
>-----Original Message-----
>From: Paula Durán Trejos [mailto:paudurtr@h...]
>Sent: Wednesday, February 21, 2001 11:30 PM
>To: ASP Web HowTo
>Subject: [asp_web_howto] How to get a client variable and using it in
>the server script.
>
>
>Hi!!!
>I need to display a message box and get the value of the answer of the
>user and depending of the answer make some changes in the database, so
>it's server script. The code is like that:
>
>if FormatNumber(strCuenta) <> 0 then
>%>
> <script language="javascript">
> intRespuesta = MsgBox("<%=Session("Mensaje_Orden")%>")
> </script>
><%
>end if
>
>When I have the value of intRespuesta, I need to do something like that
>
>If intRespuesta = 7 then
> '...Some procedure which access the database
>end if
>
>I appreciate some help...
>
>Paula.
>
>
Message #4 by "Wally Burfine" <oopconsultant@h...> on Wed, 21 Feb 2001 20:31:32 -0000
|
|
Try this:
ans = msgbox("Msg",vbyesnocancel,"title")
if ans = vbyes then
Elseif ans=vbcancel then
Else
end if
Message #5 by "Paula Durán Trejos" <paudurtr@h...> on Wed, 21 Feb 2001 14:41:51 -0600
|
|
I need to run the msgbox in the client, because in the server script I don't
have permissions to make it.
Your answer is good, but how do you pass the value of ans to the server and
execute some process in the database? Some people say me it could be, but if
there is a way to do it, I want to learn it.
>From: "Wally Burfine" <oopconsultant@h...>
>Reply-To: "ASP Web HowTo" <asp_web_howto@p...>
>To: "ASP Web HowTo" <asp_web_howto@p...>
>Subject: [asp_web_howto] RE: How to get a client variable and using it in
>the server script.
>Date: Wed, 21 Feb 2001 20:31:32 -0000
>
>Try this:
>
>ans = msgbox("Msg",vbyesnocancel,"title")
>if ans = vbyes then
>Elseif ans=vbcancel then
>Else
>end if
>
Message #6 by "Drew, Ron" <RDrew@B...> on Wed, 21 Feb 2001 16:29:17 -0500
|
|
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C09C4D.5898FD10
Content-Type: text/plain
Short Javascript. Change the if else to execute.
...........................................................................
<html>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var agree=confirm("OK to keep going, Cancel goes back one. OK?");
if (agree)
document.write("OK entered");
else
document.write("Cancel entered");
// End -->
</SCRIPT>
</head>
<body>
<p><center>
<font face="arial, helvetica" size="-2">Have Fun!!<br>
</font>
</center><p>
</body>
</html>
...........................................................................
-----Original Message-----
From: Paula Duran Trejos [mailto:paudurtr@h...]
Sent: Wednesday, February 21, 2001 3:17 PM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: How to get a client variable and using it
in the server script.
I need to get the value of the msgbox, example: Ok, No, Yes, Cancel... If
the value is Ok, or Yes I need to run a process in the server...
>From: "Alex Shiell, ITS, EC, SE" <alex.shiell@s...>
>Reply-To: "ASP Web HowTo" <asp_web_howto@p...>
>To: "ASP Web HowTo" <asp_web_howto@p...>
>Subject: [asp_web_howto] RE: How to get a client variable and using it in
> the server script.
>Date: Wed, 21 Feb 2001 15:22:13 -0000
>
>Not quite sure what you're asking... do you want to know how to get the
>input from the user?
>
>-----Original Message-----
>From: Paula Duran Trejos [mailto:paudurtr@h...]
>Sent: Wednesday, February 21, 2001 11:30 PM
>To: ASP Web HowTo
>Subject: [asp_web_howto] How to get a client variable and using it in
>the server script.
>
>
>Hi!!!
>I need to display a message box and get the value of the answer of the
>user and depending of the answer make some changes in the database, so
>it's server script. The code is like that:
>
>if FormatNumber(strCuenta) <> 0 then
>%>
> <script language="javascript">
> intRespuesta = MsgBox("<%=Session("Mensaje_Orden")%>")
> </script>
><%
>end if
>
>When I have the value of intRespuesta, I need to do something like that
>
>If intRespuesta = 7 then
> '...Some procedure which access the database
>end if
>
>I appreciate some help...
>
>Paula.
>
>
$subst('Email.Unsub')
Message #7 by "Drew, Ron" <RDrew@B...> on Wed, 21 Feb 2001 16:30:03 -0500
|
|
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C09C4D.73882150
Content-Type: text/plain
even better
-----Original Message-----
From: Wally Burfine [mailto:oopconsultant@h...]
Sent: Wednesday, February 21, 2001 3:32 PM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: How to get a client variable and using it
in the server script.
Try this:
ans = msgbox("Msg",vbyesnocancel,"title")
if ans = vbyes then
Elseif ans=vbcancel then
Else
end if
$subst('Email.Unsub')
Message #8 by Imar Spaanjaars <Imar@S...> on Wed, 21 Feb 2001 22:56:35 +0100
|
|
Aha, I'll add something to my previous message:
First, use ASP or HTML to write out a hidden form tag. Include a hidden field
<FORM action="page2.asp" method="post" name="frmMyForm">
<input type="hidden" id="txtValue" name="txtValue">
<input type="button" value="Button" id="button1" name="button1"
onclick="return button1_onclick()">
</form>
When this form is submitted, you can retrieve the value from txtValue by
using the Request.Form collection like this:
<%
Dim sTest
sTest = Request.Form("txtValue")
' Server side, do whatever you want now with sTest
%>
But, you might wonder, how do we get the value in the hidden field? The
answer is simple; use JavaScript, combined with the prompt dialog:
<script language="JavaScript">
<!--
function button1_onclick() {
var myValue;
myValue = "200000";
// the prompt box will be pre-filled with any value for myValue
myValue = prompt("Please type in something", myValue)
if (myValue < 1000) // I just made up an if / then test here
{
'// value is not ok, so cancel
return false;
}
else
{
// value is OK. Copy to hidden field and submit
document.frmMyForm.txtValue.value = myValue;
document.frmMyForm.submit();
}
}
//-->
</SCRIPT>
This code is rather untested so it goes with the usual disclaimer about
warranties etc, but I think it will do the trick for you.
Let me know if it worked.
Imar
At 02:41 PM 2/21/2001 -0600, you wrote:
>I need to run the msgbox in the client, because in the server script I
>don't have permissions to make it.
>Your answer is good, but how do you pass the value of ans to the server
>and execute some process in the database? Some people say me it could be,
>but if there is a way to do it, I want to learn it.
>
>>From: "Wally Burfine" <oopconsultant@h...>
>>Reply-To: "ASP Web HowTo" <asp_web_howto@p...>
>>To: "ASP Web HowTo" <asp_web_howto@p...>
>>Subject: [asp_web_howto] RE: How to get a client variable and using it in
>>the server script.
>>Date: Wed, 21 Feb 2001 20:31:32 -0000
>>
>>Try this:
>>
>>ans = msgbox("Msg",vbyesnocancel,"title")
>>if ans = vbyes then
>>Elseif ans=vbcancel then
>>Else
>>end if
Message #9 by "Wally Burfine" <oopconsultant@h...> on Wed, 21 Feb 2001 22:39:10 -0000
|
|
Try this:
function awbOnClick()
ans = msgbox("Msg",vbyesnocancel,"title")
if ans = vbyes then
' The Yes Case
frmMyForm.Action = frmMyForm.Action & "?Ans=Yes"
frmMyForm.Submit()
Elseif ans=vbcancel then
' Do nothing
Else
' The no case
frmMyForm.Action = frmMyForm.Action & "?Ans=No"
frmMyForm.Submit()
end if
If you wanted to send the user to a different form based upon his answer,
you could substitute the following:
ans = msgbox("Msg",vbyesnocancel,"title")
if ans = vbyes then
' The Yes Case
frmMyForm.Action = "YesAnswer.asp"
frmMyForm.Submit()
Elseif ans=vbcancel then
' Do nothing
Else
' The no case
frmMyForm.Action = "NoAnswer.asp"
frmMyForm.Submit()
end if
Amoung other ways of doing things
Regards,
Wally
Message #10 by "Paula Durán Trejos" <paudurtr@h...> on Thu, 22 Feb 2001 08:32:03 -0600
|
|
I tried to make that but in which part of the code I have to add this code,
I have the msgbox before the definition of the form. Should I move it inside
the definition of the form???
>From: "Wally Burfine" <oopconsultant@h...>
>Reply-To: "ASP Web HowTo" <asp_web_howto@p...>
>To: "ASP Web HowTo" <asp_web_howto@p...>
>Subject: [asp_web_howto] RE: How to get a client variable and using it in
>the server script.
>Date: Wed, 21 Feb 2001 22:39:10 -0000
>
>Try this:
>
>function awbOnClick()
>ans = msgbox("Msg",vbyesnocancel,"title")
>if ans = vbyes then
> ' The Yes Case
> frmMyForm.Action = frmMyForm.Action & "?Ans=Yes"
> frmMyForm.Submit()
>Elseif ans=vbcancel then
> ' Do nothing
>Else
> ' The no case
> frmMyForm.Action = frmMyForm.Action & "?Ans=No"
> frmMyForm.Submit()
>end if
>
>If you wanted to send the user to a different form based upon his answer,
>you could substitute the following:
>
>ans = msgbox("Msg",vbyesnocancel,"title")
>if ans = vbyes then
> ' The Yes Case
> frmMyForm.Action = "YesAnswer.asp"
> frmMyForm.Submit()
>Elseif ans=vbcancel then
> ' Do nothing
>Else
> ' The no case
> frmMyForm.Action = "NoAnswer.asp"
> frmMyForm.Submit()
>end if
>
>Amoung other ways of doing things
>Regards,
>Wally
>
Message #11 by "Paula Durán Trejos" <paudurtr@h...> on Thu, 22 Feb 2001 09:51:38 -0600
|
|
It works!!! Thanks
>From: "Wally Burfine" <oopconsultant@h...>
>Reply-To: "ASP Web HowTo" <asp_web_howto@p...>
>To: "ASP Web HowTo" <asp_web_howto@p...>
>Subject: [asp_web_howto] RE: How to get a client variable and using it in
>the server script.
>Date: Wed, 21 Feb 2001 22:39:10 -0000
>
>Try this:
>
>function awbOnClick()
>ans = msgbox("Msg",vbyesnocancel,"title")
>if ans = vbyes then
> ' The Yes Case
> frmMyForm.Action = frmMyForm.Action & "?Ans=Yes"
> frmMyForm.Submit()
>Elseif ans=vbcancel then
> ' Do nothing
>Else
> ' The no case
> frmMyForm.Action = frmMyForm.Action & "?Ans=No"
> frmMyForm.Submit()
>end if
>
>If you wanted to send the user to a different form based upon his answer,
>you could substitute the following:
>
>ans = msgbox("Msg",vbyesnocancel,"title")
>if ans = vbyes then
> ' The Yes Case
> frmMyForm.Action = "YesAnswer.asp"
> frmMyForm.Submit()
>Elseif ans=vbcancel then
> ' Do nothing
>Else
> ' The no case
> frmMyForm.Action = "NoAnswer.asp"
> frmMyForm.Submit()
>end if
>
>Amoung other ways of doing things
>Regards,
>Wally
>
Message #12 by "Wally Burfine" <oopconsultant@h...> on Thu, 22 Feb 2001 16:02:59 -0000
|
|
You would put the code in as such:
<head>
<script LANGUAGE=VBSCRIPT>
function awbOnClick()
ans = msgbox("Msg",vbyesnocancel,"title")
if ans = vbyes then
...
</script>
</head>
<body ....>
<form ....>
...
<input type=button onclick='awbOnClick()' ...>
...
</...
Regards,
Wally
>From: "Paula Durán Trejos" <paudurtr@h...>
>Reply-To: "ASP Web HowTo" <asp_web_howto@p...>
>To: "ASP Web HowTo" <asp_web_howto@p...>
>Subject: [asp_web_howto] RE: How to get a client variable and using it in
>the server script.
>Date: Thu, 22 Feb 2001 08:32:03 -0600
>
>I tried to make that but in which part of the code I have to add this code,
>I have the msgbox before the definition of the form. Should I move it
>inside
>the definition of the form???
>
>
>>From: "Wally Burfine" <oopconsultant@h...>
>>Reply-To: "ASP Web HowTo" <asp_web_howto@p...>
>>To: "ASP Web HowTo" <asp_web_howto@p...>
>>Subject: [asp_web_howto] RE: How to get a client variable and using it in
>>the server script.
>>Date: Wed, 21 Feb 2001 22:39:10 -0000
>>
>>Try this:
>>
>>function awbOnClick()
>>ans = msgbox("Msg",vbyesnocancel,"title")
>>if ans = vbyes then
>> ' The Yes Case
>> frmMyForm.Action = frmMyForm.Action & "?Ans=Yes"
>> frmMyForm.Submit()
>>Elseif ans=vbcancel then
>> ' Do nothing
>>Else
>> ' The no case
>> frmMyForm.Action = frmMyForm.Action & "?Ans=No"
>> frmMyForm.Submit()
>>end if
>>
>>If you wanted to send the user to a different form based upon his answer,
>>you could substitute the following:
>>
>>ans = msgbox("Msg",vbyesnocancel,"title")
>>if ans = vbyes then
>> ' The Yes Case
>> frmMyForm.Action = "YesAnswer.asp"
>> frmMyForm.Submit()
>>Elseif ans=vbcancel then
>> ' Do nothing
>>Else
>> ' The no case
>> frmMyForm.Action = "NoAnswer.asp"
>> frmMyForm.Submit()
>>end if
>>
>>Amoung other ways of doing things
>>Regards,
>>Wally
>>
Message #13 by <mzcfilip@y...> on Thu, 22 Feb 2001 11:13:48 -0500
|
|
client-side vbscript only functions in IE though, isn't that right?
-----Original Message-----
From: Wally Burfine [mailto:oopconsultant@h...]
Sent: Thursday, February 22, 2001 11:03 AM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: How to get a client variable and using it
in the server script.
You would put the code in as such:
<head>
<script LANGUAGE=VBSCRIPT>
function awbOnClick()
ans = msgbox("Msg",vbyesnocancel,"title")
if ans = vbyes then
...
</script>
</head>
<body ....>
<form ....>
...
<input type=button onclick='awbOnClick()' ...>
...
</...
Regards,
Wally
>From: "Paula Durán Trejos" <paudurtr@h...>
>Reply-To: "ASP Web HowTo" <asp_web_howto@p...>
>To: "ASP Web HowTo" <asp_web_howto@p...>
>Subject: [asp_web_howto] RE: How to get a client variable and using it in
>the server script.
>Date: Thu, 22 Feb 2001 08:32:03 -0600
>
>I tried to make that but in which part of the code I have to add this code,
>I have the msgbox before the definition of the form. Should I move it
>inside
>the definition of the form???
>
>
>>From: "Wally Burfine" <oopconsultant@h...>
>>Reply-To: "ASP Web HowTo" <asp_web_howto@p...>
>>To: "ASP Web HowTo" <asp_web_howto@p...>
>>Subject: [asp_web_howto] RE: How to get a client variable and using it in
>>the server script.
>>Date: Wed, 21 Feb 2001 22:39:10 -0000
>>
>>Try this:
>>
>>function awbOnClick()
>>ans = msgbox("Msg",vbyesnocancel,"title")
>>if ans = vbyes then
>> ' The Yes Case
>> frmMyForm.Action = frmMyForm.Action & "?Ans=Yes"
>> frmMyForm.Submit()
>>Elseif ans=vbcancel then
>> ' Do nothing
>>Else
>> ' The no case
>> frmMyForm.Action = frmMyForm.Action & "?Ans=No"
>> frmMyForm.Submit()
>>end if
>>
>>If you wanted to send the user to a different form based upon his answer,
>>you could substitute the following:
>>
>>ans = msgbox("Msg",vbyesnocancel,"title")
>>if ans = vbyes then
>> ' The Yes Case
>> frmMyForm.Action = "YesAnswer.asp"
>> frmMyForm.Submit()
>>Elseif ans=vbcancel then
>> ' Do nothing
>>Else
>> ' The no case
>> frmMyForm.Action = "NoAnswer.asp"
>> frmMyForm.Submit()
>>end if
>>
>>Amoung other ways of doing things
>>Regards,
>>Wally
>>
Message #14 by "Wally Burfine" <oopconsultant@h...> on Thu, 22 Feb 2001 16:18:15 -0000
|
|
Correct. I'm not sure if there is any other browser that supports client
side VBScript.
Regards,
Wally
>From: "Michael Filip \(Yahoo\)" <mzcfilip@y...>
>Reply-To: "ASP Web HowTo" <asp_web_howto@p...>
>To: "ASP Web HowTo" <asp_web_howto@p...>
>Subject: [asp_web_howto] RE: How to get a client variable and using it in
>the server script.
>Date: Thu, 22 Feb 2001 11:13:48 -0500
>
>client-side vbscript only functions in IE though, isn't that right?
>
>
>-----Original Message-----
>From: Wally Burfine [mailto:oopconsultant@h...]
>Sent: Thursday, February 22, 2001 11:03 AM
>To: ASP Web HowTo
>Subject: [asp_web_howto] RE: How to get a client variable and using it
>in the server script.
>
>
>You would put the code in as such:
><head>
><script LANGUAGE=VBSCRIPT>
>function awbOnClick()
> ans = msgbox("Msg",vbyesnocancel,"title")
> if ans = vbyes then
>...
></script>
></head>
><body ....>
><form ....>
>...
><input type=button onclick='awbOnClick()' ...>
>...
></...
>
>
>Regards,
>Wally
>
>
> >From: "Paula Durán Trejos" <paudurtr@h...>
> >Reply-To: "ASP Web HowTo" <asp_web_howto@p...>
> >To: "ASP Web HowTo" <asp_web_howto@p...>
> >Subject: [asp_web_howto] RE: How to get a client variable and using it in
> >the server script.
> >Date: Thu, 22 Feb 2001 08:32:03 -0600
> >
> >I tried to make that but in which part of the code I have to add this
>code,
> >I have the msgbox before the definition of the form. Should I move it
> >inside
> >the definition of the form???
> >
> >
> >>From: "Wally Burfine" <oopconsultant@h...>
> >>Reply-To: "ASP Web HowTo" <asp_web_howto@p...>
> >>To: "ASP Web HowTo" <asp_web_howto@p...>
> >>Subject: [asp_web_howto] RE: How to get a client variable and using it
>in
> >>the server script.
> >>Date: Wed, 21 Feb 2001 22:39:10 -0000
> >>
> >>Try this:
> >>
> >>function awbOnClick()
> >>ans = msgbox("Msg",vbyesnocancel,"title")
> >>if ans = vbyes then
> >> ' The Yes Case
> >> frmMyForm.Action = frmMyForm.Action & "?Ans=Yes"
> >> frmMyForm.Submit()
> >>Elseif ans=vbcancel then
> >> ' Do nothing
> >>Else
> >> ' The no case
> >> frmMyForm.Action = frmMyForm.Action & "?Ans=No"
> >> frmMyForm.Submit()
> >>end if
> >>
> >>If you wanted to send the user to a different form based upon his
>answer,
> >>you could substitute the following:
> >>
> >>ans = msgbox("Msg",vbyesnocancel,"title")
> >>if ans = vbyes then
> >> ' The Yes Case
> >> frmMyForm.Action = "YesAnswer.asp"
> >> frmMyForm.Submit()
> >>Elseif ans=vbcancel then
> >> ' Do nothing
> >>Else
> >> ' The no case
> >> frmMyForm.Action = "NoAnswer.asp"
> >> frmMyForm.Submit()
> >>end if
> >>
> >>Amoung other ways of doing things
> >>Regards,
> >>Wally
> >>
>
Message #15 by "Eric Van Camp" <eric@a...> on Thu, 22 Feb 2001 17:25:01 -0000
|
|
correct. You should use Javascript to overcome crossbrowser problems...
-----Original Message-----
From: Wally Burfine [mailto:oopconsultant@h...]
Sent: Thursday, February 22, 2001 4:18 PM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: How to get a client variable and using it
in the server script.
Correct. I'm not sure if there is any other browser that supports client
side VBScript.
Regards,
Wally
>From: "Michael Filip \(Yahoo\)" <mzcfilip@y...>
>Reply-To: "ASP Web HowTo" <asp_web_howto@p...>
>To: "ASP Web HowTo" <asp_web_howto@p...>
>Subject: [asp_web_howto] RE: How to get a client variable and using it in
>the server script.
>Date: Thu, 22 Feb 2001 11:13:48 -0500
>
>client-side vbscript only functions in IE though, isn't that right?
>
>
>-----Original Message-----
>From: Wally Burfine [mailto:oopconsultant@h...]
>Sent: Thursday, February 22, 2001 11:03 AM
>To: ASP Web HowTo
>Subject: [asp_web_howto] RE: How to get a client variable and using it
>in the server script.
>
>
>You would put the code in as such:
><head>
><script LANGUAGE=VBSCRIPT>
>function awbOnClick()
> ans = msgbox("Msg",vbyesnocancel,"title")
> if ans = vbyes then
>...
></script>
></head>
><body ....>
><form ....>
>...
><input type=button onclick='awbOnClick()' ...>
>...
></...
>
>
>Regards,
>Wally
>
>
> >From: "Paula Durán Trejos" <paudurtr@h...>
> >Reply-To: "ASP Web HowTo" <asp_web_howto@p...>
> >To: "ASP Web HowTo" <asp_web_howto@p...>
> >Subject: [asp_web_howto] RE: How to get a client variable and using it in
> >the server script.
> >Date: Thu, 22 Feb 2001 08:32:03 -0600
> >
> >I tried to make that but in which part of the code I have to add this
>code,
> >I have the msgbox before the definition of the form. Should I move it
> >inside
> >the definition of the form???
> >
> >
> >>From: "Wally Burfine" <oopconsultant@h...>
> >>Reply-To: "ASP Web HowTo" <asp_web_howto@p...>
> >>To: "ASP Web HowTo" <asp_web_howto@p...>
> >>Subject: [asp_web_howto] RE: How to get a client variable and using it
>in
> >>the server script.
> >>Date: Wed, 21 Feb 2001 22:39:10 -0000
> >>
> >>Try this:
> >>
> >>function awbOnClick()
> >>ans = msgbox("Msg",vbyesnocancel,"title")
> >>if ans = vbyes then
> >> ' The Yes Case
> >> frmMyForm.Action = frmMyForm.Action & "?Ans=Yes"
> >> frmMyForm.Submit()
> >>Elseif ans=vbcancel then
> >> ' Do nothing
> >>Else
> >> ' The no case
> >> frmMyForm.Action = frmMyForm.Action & "?Ans=No"
> >> frmMyForm.Submit()
> >>end if
> >>
> >>If you wanted to send the user to a different form based upon his
>answer,
> >>you could substitute the following:
> >>
> >>ans = msgbox("Msg",vbyesnocancel,"title")
> >>if ans = vbyes then
> >> ' The Yes Case
> >> frmMyForm.Action = "YesAnswer.asp"
> >> frmMyForm.Submit()
> >>Elseif ans=vbcancel then
> >> ' Do nothing
> >>Else
> >> ' The no case
> >> frmMyForm.Action = "NoAnswer.asp"
> >> frmMyForm.Submit()
> >>end if
> >>
> >>Amoung other ways of doing things
> >>Regards,
> >>Wally
> >>
>
|
|
 |