I'm trying to create a very simple password checker, but can't get it to work. If the user enters an incorrect password, which is checked against the correct password retrieved from the database using ASP, I want a Javascript alert box to pop-up saying something like 'incorrect password, try again'.
I've tried various combinations of ASP and Javascript but it either does nothing at all or the alert box appears when the page first loads, before any password has been entered.
This is my latest unsuccessful attempt.
<%
'..code to get entered and actual passwords
if entered_password=actual_password then
Response.Redirect "gotonextpage.html"
else
response.write "<script language='javascript'>" & vbCrLF
response.write "<!--" & vbCrLF
response.write "alert('Incorrect password. Try again');" & vbCrLF
response.write "-->" & vbCrLF
response.write "</script>" & vbCrLF
end if
%>
Bookmarks