Confirm function in Javascript


<html>
<head>
<title>Confirm javascript</title>
<script>
    function validate()
    {
      var confirmMessage="Are you sure to move Yahoo home page!";

      if(confirm(confirmMessage)==false)
      {
          return false;
      }
    }
</script>
</head>

<body>
    <form name="frm" action="http://yahoo.com" onSubmit="return validate()">
       <input type="submit" name="goSubmit" value="Submit" />
    </form>
</body>
</html>

0 comments:

Post a Comment

 
 
 
 


Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies|