Link to home
Start Free TrialLog in
Avatar of jhmoen
jhmoen

asked on

popup when condition is true

I have the following situation, but not sure of the syntax here.  What I want to do is popup a browser window if the IF conditions are true.

<%
' IF TODAYS DATE IS > PROJECTED DATE OR NO RECORD RETURNED>>>>DISPLAY POPUP REMINDER
      if Date() > (projectedRS.Fields.Item("ProjectedDate")) then
            'load browser popup
                  <A HREF="javascript:window.open('reminder.asp','reminder','scrollbars=yes,width=400,height=400');" ></A>
      else
            if projectedRS.EOF or projectedRS.BOF then
                  'load browser popup
                        <A HREF="javascript:window.open('reminder.asp','reminder','scrollbars=yes,width=400,height=400');" ></A>
            else
                  'do nothing stay here
      end if
end if

The error I get is:
Expected Statement: on this line: <A HREF="javascript:window.open('reminder.asp','reminder','scrollbars=yes,width=400,height=400');" ></A>

%>
SOLUTION
Avatar of rohanbairat3
rohanbairat3

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jhmoen
jhmoen

ASKER

okay cool.
I am going with a javascript function with this, but my syntax is still wrong in comparing the dates:

<%
' IF TODAYS DATE IS > PROJECTED DATE OR NO RECORD RETURNED>>>>DISPLAY POPUP REMINDER
      if Date() > (projectedRS.Fields.Item("ProjectedDate")) then
            load browser popup
                  return submitForm()
      else
                      if projectedRS.EOF or projectedRS.BOF then
                  'load browser popup
                        return submitForm()
            else
                  'do nothing stay here
                end if
end if
%>

AND my function is as:
function submitForm(){
var newwindow;
var objForm = document.forms['form1'];
newwindow=window.open('reminder.asp','reminder','height=600,width=600');
objForm.action = "newwindow"
return true;
}

Can't get to my function yet, because of the dates problem...any ideas

UPED THE POINTS
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jhmoen

ASKER

good to know, that probably helps but I can't get the date compares line to work yet, so I don't even get there yet, but thanks.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial