Created
April 20, 2012 20:51
-
-
Save jhpowell82/2431822 to your computer and use it in GitHub Desktop.
Gist jsFiddle Test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input.required { background-color: #EDA } | |
label { width: 10em; float: left; } | |
label.error { float: none; color: red; padding-left: .5em; vertical-align: top; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form method="post" id="contactForm"> | |
<table> | |
<tr> | |
<td><label for="txtName">Name:</label></td><td><input type="text" class="required" name="txtName" id="txtName"/></td> | |
</tr> | |
<tr> | |
<td><label for="txtEmail">Email:</label></td><td><input type="text" class="required email" name="txtEmail" id="txtEmail"/></td> | |
</tr> | |
<tr> | |
<td>Phone Number:</td><td><input type="text" title="Phone" name="txtPhone" id="txtPhone"/></td> | |
</tr> | |
<tr> | |
<td colspan="2">Preferred contact method:</td> | |
</tr> | |
<tr> | |
<td colspan="2"> | |
<input type="radio" name="radioContactMethod" id="radioContactMethod" value="E" checked="checked" />Email | |
<input type="radio" name="radioContactMethod" id="radioContactMethod" value="P" disabled />Phone | |
</td> | |
</tr> | |
<tr> | |
<td colspan="2"> | |
Notes: | |
</td> | |
</tr> | |
<tr> | |
<td colspan="2"> | |
<textarea name="txtNotes"></textarea> | |
</td> | |
</tr> | |
<tr> | |
<td><button onClick="$('#contactForm').validate();">Submit</button></td> | |
</tr> | |
</table> | |
</form> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
$("#contactForm").validate(); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Demo | |
description: Demo | |
authors: | |
- Jonathan Powell | |
resources: | |
- http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.js | |
normalize_css: no |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment