[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

popup when condition is true

Posted on 2005-05-10
5
Medium Priority
?
342 Views
Last Modified: 2010-10-05
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>

%>
0
Comment
Question by:jhmoen
  • 2
  • 2
5 Comments
 
LVL 7

Assisted Solution

by:rohanbairat3
rohanbairat3 earned 400 total points
ID: 13971215
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
 

Author Comment

by:jhmoen
ID: 13971656
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
 
LVL 3

Assisted Solution

by:Neil Thompson
Neil Thompson earned 200 total points
ID: 13971717
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
 

Author Comment

by:jhmoen
ID: 13971771
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
 
LVL 7

Accepted Solution

by:
rohanbairat3 earned 400 total points
ID: 13971873
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question