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

Hello, cant make this script to go.

Status
Not open for further replies.

atferraz

Technical User
Aug 23, 2003
129
PT
<%
nstate = rs(&quot;nstate&quot;)
observ = rs(&quot;observ&quot;)
if cInt(nstate)>0 then
%>
<script type=&quot;text/javascript&quot;>
var nstate =<%=nstate%>;
var observ =&quot;<%=observ%>&quot;;
popUp(nstate,observ);
</script>
<%
if cInt(nstate)=2 and cInt(Session(&quot;UserNfunc&quot;))>0 then
response.Redirect&quot;Main_Backgr.asp&quot;
exit sub
end if
end if
%>

This script tests if the state of a DB row is 0,1 or 2. If it is 1 or 2 shows a message in a popup window. That’s what popup() do.
When is 2, it should redirect the user out, after that popup window close.(it is a modal window)
The problem is that when both cInt(nstate)=2 and cInt(Session(&quot;UserNfunc&quot;))>0 conditions are true it gets redirect but doesn’t show the pop up window.

Please some one

 
Try this...


<%
nstate = rs(&quot;nstate&quot;)
observ = rs(&quot;observ&quot;)
if cInt(nstate)>0 then
%>
<script type=&quot;text/javascript&quot;>
var nstate =<%=nstate%>;
var observ =&quot;<%=observ%>&quot;;
popUp(nstate,observ);
<% if cInt(nstate)=2 and cInt(Session(&quot;UserNfunc&quot;))>0 then response.write &quot;this.location.href=&quot;&quot;Main_Backgr.asp&quot;&quot;&quot; %>
</script>
<%
end if
%>

 
got you GaryC123
it work just fine
thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top