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!

ASP IF/THEN Help needed

Status
Not open for further replies.

Tread42

MIS
Feb 5, 2002
151
0
0
US
I've been playing with this and it's about to drive me nuts! I'm trying to check the val of current customer and if it's 0 I want both windows to pop. If it's 1 I only want the second to pop. Can anyone help me out? Here's the code. It's my first time posting code here so sorry if it's sloppy or in the wrong format.

Thanks


onload=&quot; <%If Session(&quot;currentcustomer&quot;)=0 then%>javascript: window.open('notice_delay.asp?recordid=<%=recordid%>','delay','height=500,width=680,toolbar=yes,menubar=yes,location=no,scrollbars=yes,resizable=yes'); void('');javascript: window.open('Card.asp?recordid=<%=recordid%>','sigcard','height=500,width=680,toolbar=yes,menubar=yes,location=no,scrollbars=yes,resizable=yes'); void('');&quot;<%END IF%><%If Session(&quot;currentcustomer&quot;)=1 then%>javascript: window.open('Card.asp?recordid=<%=recordid%>','sigcard','height=500,width=680,toolbar=yes,menubar=yes,location=no,scrollbars=yes,resizable=yes'); void('');&quot;<%End If%> Regards,
Tread42
 
Hi Tread42!

What makes you nuts - ASP or JavaScript? What exactly doesn't work? Good Luck! :)
 
Hard to tell what the problem is, but you might need to use

If cStr(Session(&quot;currentcustomer&quot;)) = &quot;0&quot;...

 
try this instead:

<%

tempTxt=&quot;&quot;

If Session(&quot;currentcustomer&quot;)=0 then

tempTxt=&quot;javascript: window.open('notice_delay.asp?recordid=&quot; & recordid & &quot;','delay','height=500, width=680, toolbar=yes, menubar=yes, location=no, scrollbars=yes, resizable=yes'); void('');javascript: window.open('Card.asp?recordid=&quot; & recordid & &quot;','sigcard', 'height=500, width=680, toolbar=yes, menubar=yes, location=no, scrollbars=yes, resizable=yes'); void('');&quot;
END IF

If Session(&quot;currentcustomer&quot;)=1 then
tempTxt=&quot;javascript: window.open('Card.asp?recordid=&quot; & recordid& &quot;','sigcard','height=500, width=680, toolbar=yes, menubar=yes, location=no, scrollbars=yes,resizable=yes'); void('');&quot;

End If

%>


then on the onload field:

onload=&quot;<%=tempTxt%>&quot;



Actually, what I did was just simplify your code. I hope this solves ur problem.


biggie

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top