A Quick Javascript Contact Form



<script>
function validateForm()
{
var x=document.forms["myForm"]["name"].value;
var x=document.forms["myForm"]["email"].value;

if (x==null || x=="" || y==null || y=="")
  {
 document.getElementById('myDiv').innerHTML = '<span style="font-weight:bold;color:#800000">***Please fill in all requred fileds.</span>';
  return false;
  }
}
</script>

<div id="myDiv"> </div>
<div id="comments">
<form action="thank-you.aspx" method="post" name="myForm" onsubmit="return validateForm()">
          <p>
            <input type="text" name="name" id="name" value="" size="22">
            <label for="name"><small>Name (required)</small></label>
          </p>
          <p>
            <input type="text" name="email" id="email" value="" size="22">
            <label for="email"><small>Mail (required)</small></label>
          </p>
          <p>
            <textarea name="comment" id="comment" cols="25" rows="10"></textarea>
            <label for="comment" class="hidden"><small>Comment (required)</small></label>
          </p>
          <p>
            <input name="submit" type="submit" id="submit" value="Submit Form">
           </p>
        </form>
</div>

Comments

Popular posts from this blog

Umbraco Razor Sort Nodes Ascending or Descending

Umbraco Razor get Querystring

Create a .NET Contact Form that Gets the Last Url Visited in C# Can also be Used in Umbraco