[thelist] JS Form Validation

Brian Cummiskey Brian at hondaswap.com
Thu Jul 1 19:03:52 CDT 2004


function ValidateForm()
{
    if(IsEmpty(myForm.realname))
    {
       alert('You have not entered a first name')
       document.myform.realname.focus();
       return false;
    }

    else
    {
        myForm.action = "mailto.php";
        myForm.method = "post";
            myForm.submit();
        alert("Hi. it worked");
            return (true);
    }
}
 </script>

</head>
<body>
 <form name="myForm" action="">

         <input type="hidden" name="recipient" value="blahblah at blah.com">

         <input type="hidden" name="subject" value="TEST">

         <input type="hidden" name="redirect" 
value="http://www.roaringforkvehicles.com/thankyou.html">
                               
         <input type="text" name="realname" size="5">
                               
         <input type="button" name="submit" value="submit" 
onclick="ValidateForm();">
 </form>




More information about the thelist mailing list