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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compound conditions question

Status
Not open for further replies.

rosn459

Programmer
Sep 18, 2003
37
0
0
US
I have three conditions within a VBScript. For some reason, all three seem to execute regardless of what is selected. (Ex: The e-mail is sent if the user enters no, or yes. I only want the e-mail sent if the value of what the user enters exceeds 50000.) Below is my code. What am I missing?

Dim MyVar
MyVar=MsgBox("You have entered xyz. Do you want to continue?",292,"Warning")
If MyVar=7 Then
window.location="returntoform.asp"
ElseIf MyVar=6 And <output>#XYZ#</output> > 50000 And <output>#XYZ#</cfoutput> < 10000 Then
window.opener.location.reload()
window.close

ElseIf MyVar=6 And <output>#XYZ#</output> > 50000 Then
<mail to="#recipient#" from="#sender#" subject="">
Message Text Goes Here
</mail>
End If
 
Hello rosn459,

How do you arrive at all at this script? Where does it suppose to put?

regards - tsuji
 
This script runs only if another condition exists.

Ex:

<cfif Condition Y>
<script language="VBScript">
Dim MyVar
MyVar=MsgBox("You have entered xyz. Do you want to continue?",292,"Warning")
If MyVar=7 Then
window.location="returntoform.asp"
ElseIf MyVar=6 And <output>#XYZ#</output> > 50000 And <output>#XYZ#</cfoutput> < 10000 Then
window.opener.location.reload()
window.close

ElseIf MyVar=6 And <output>#XYZ#</output> > 50000 Then
<mail to="#recipient#" from="#sender#" subject="">
Message Text Goes Here
</mail>
End If
</cfif>

This is just part of the other processing my page does.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top