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>

%>
jhmoenAsked:
Who is Participating?
 
rohanbairat3Connect With a Mentor Commented:
The date comparison is in ASP or javascript ???


if its in ASP use DateDiff function ... that way u get to know diff in seconds ...it will give u a negative value if its less than the date u aare comparing with

-rohan
0
 
rohanbairat3Connect With a Mentor Commented:
u dont need an A HREF ..cause that would just create a hyperlink

instead u can write something like
<%
'ASPCODE

%>

<script>
window.open('reminder.asp','reminder','scrollbars=yes,width=400,height=400');
</script>

<%
'ASP COde
%>
0
 
jhmoenAuthor Commented:
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
0
 
Neil ThompsonConnect With a Mentor Senior Systems DeveloperCommented:
long shot but i had a prob like this before and it was solved by simply moving the else if to elseif (1 word)

Neil
0
 
jhmoenAuthor Commented:
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.