View Full Version : Button wont work unless refreshed

04-30-2007, 09:09 AM
Hi .. !! everything works fine in this code.. but the only problem I can use the button just once, unless I refresh the page. Thanks in advance. _________________________________________________________________
<script type="text/javascript">
function email()
email = window.prompt("WHAT IS YOUR E-MAIL ADDRESS?");
test ()
function test()
if (email.indexOf('@') != -1)
{ alert ("VALID E-MAIL");
write() }
{ alert("INVALID EMAIL"); }

<title>Page 6</title>

<input type="button"
value="Click Here !!">

<script type="text/javascript">
function write()
alert("Thankyou For Entering Your E-Mail Address");


04-30-2007, 09:31 AM
The problem is in..
email = window.prompt("WHAT IS YOUR E-MAIL ADDRESS?");

Once it executed, the email function disappears !

Change that variable name to say 'email1' and make changes in the following lines also..