[thelist] sending pop-up to client within asp

Chris.Marsh at Callserve.com Chris.Marsh at Callserve.com
Mon Mar 7 06:54:32 CST 2005


> I have written a password checking app when my users login.
> If their password expires in 15 or less days I want to send a 
> javascript 
> alert or confirm that informs them of when their password
> expires. After they click ok, it re-directs them to the desired app.
> The problem is that this codes works, but leaves the user at 
> a blank page.
>  if vpwdexpire < 15 AND vpwdexpire <> 0 then
>     MsgStr = "Your password will expire in " & vpwdexpire & " days, 
> please change it."
>    Response.Write("<script language='javascript'>confirm('" & 
> MsgStr & 
> "')</script>")
>    response.end
>  end if
> The next line of code re-directs them to the application.
> So how do I  send the user a pop-up that informs them of when their 
> password expires and after they click ok, the program directs 
> them to the
> app?
> If the password is = 0 it send an alert and send them to the 
> login page.

The redirect should be done via javascript in this case.

The "confirm" alert in javascript is more usually used when the user has a
choice. Consider the following message: "Your password will expire in x
days. Would you like to change it now?". You could use the following

if(confirm("Your password will expire in x days. Would you like to change it
  document.location.href = "password_change.asp";

If, however, you are forcing the user to go to another page if their
password requires changing - an alert box may be more appropriate; thus:

alert("Your password will expire in x days. Please change it now.");
document.location.href = "password_change.asp";


Chris Marsh

This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the sender and delete the email immediately. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. 

Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company.

Finally, the recipient should check this email and any attachments for the presence of viruses. Callserve Communications accepts no liability for any damage caused by any virus transmitted by this email. _______________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan

More information about the thelist mailing list