<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
if(loc == -1)
alert('you entered an inaccurate email addy.')
<FORM action="http://www.jimkeogh.com" method="post">
First Name: <INPUT type="text" name="Fname"/><BR>
Last Name: <INPUT type="text" name="Lname"/><BR>
Email: <INPUT type="text" name="Email" onblur="ValidateEmail (this.value)"/><BR>
<INPUT name="Submit" value="Submit" type="submit"/>
<INPUT name="Reset" value="Reset" type="reset"/>
When I try to load it in a browser, the form loads fine but the browser isn't displaying an alert box. So I don't even know if it is calling the function correctly. Could someone look over this and explain whats going on or what I've done wrong?
It is saying the error is in line 1, and is pointing out ValidateEmail portion of the function, saying it is not defined. see below pic. I'm not sure why it's not defined and could you please point out what I need to do here?
To ziggyism, I'm glad the code I provided is working correctly for you... it's nice to know that it is working properly. I'm quite clear on what the onblur and all the other tags that you can use like it do, what I was really concerned about was the fact that the browser would not execute that code correctly, tho it was copied verbatim from the book. I'm having similar issues with a couple of other examples on into chap 7 of the book.
And to nathanpc, the topic title was to get people to look at the forum post quickly , know that im new, and once you read the question contained in my first forum post then you know exactly what I was asking (tho sorry if it wasn't up to par for you). And i never said i got rid of the html and code tags i said i got rid of the junk in them... aka the parts that were completely unnecessary.