How do i validate an email address in a prompt box

Trying to make a 2 page application. First is an introduction page and second is the content. Ive put a pop up box in the head of the second page and it asks for email, but how do i make it so if the email is incorrect it will not go onto the second page? at present if i click the link for the second page the box pops up but that is it. I can document.write their response and it comes on the top of the second page, but i want it validated! Any ideas?

Alan.

Hy
You can use the match(‘regexp’) method. It returns the matches or null.
Here is an example:


<script type="text/javascript"><!--
var str = "abc@defg.hy";
var regx = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,4}$/gi;
if(str.match(regx)!=null) alert(str.match(regx));    // on
--></script>