Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

yes / no popup, directs to certain page 1

Status
Not open for further replies.

andycape

Programmer
Aug 22, 2003
177
ZA
How do i create a popup using vbscript from an ASP page that answers a question and if i click yes the webpage will change to one page, if i click no it will change to a different one.

thanx.
 
Be aware that MsgBox can only be called client side.
You may then play with open method or location property.

Hope This Help
PH.
 
i have it working now, just the dialog box has OK and cancel, not yes and no like i would prefer.
 
Use vbYesNo (4) as 2nd argument of the MsgBox function.

Hope This Help
PH.
 
i'm not using the msgbox function, i'm using confirm. couldnt get the vbYesNo to work.Let me know if you know how to do the following below as a vbYesNo instead.
thanx

I'm using :

<script>
function a()
{

if (confirm('Do you not want to add linear meters?'))
document.location.href=&quot;CreatePieces.asp&quot;
else
document.location.href=&quot;CreateActions.asp&quot;

return false;
}
</script>
<body onload=&quot;a()&quot;>
</body>
</script>
 
This is javascript and you post in vbscript forum !
 
yes I know, i'm saying if you know how to get the same result using vbYesNo
 
Something like this ?
<script language=VBScript>
Function a()
If MsgBox(&quot;Do you not want to add linear meters?&quot;,vbYesNo)=vbYes Then
document.location.href=&quot;CreatePieces.asp&quot;
Else
document.location.href=&quot;CreateActions.asp&quot;
a=False
End Function
</script>

Hope This Help
PH.
 
exactly that kind of thing, except that code isnt working ;-)


I'm getting an error saying expecting If on the last line ?
 
andycape,

It should if only you take initiative to correct a kind of typo!
Code:
a=False
[COLOR=red]End If[/color]
End Function
regards - tsuji
 
My turn of carelessness!
Code:
'...
End If
a=False
End Function
- tsuji
 
excellent thanx both of you, i did play with it a little but but did't spot that.
 
Good catch tsuji, I'm gratefull for your response [lol]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top