Created
August 29, 2013 23:56
-
-
Save PintuKumarPal/6384815 to your computer and use it in GitHub Desktop.
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
<cfoutput> | |
<script type="text/javascript" src="includes/jquery.js"></script> | |
<script type="text/javascript" src="includes/jquery.validate.pack.js"></script> | |
<script type="text/javascript" src="includes/jquery.form.js"></script> | |
<script type="text/javascript"> | |
function ProcessValidateForm() | |
{ | |
$("##ProcessStatus").html('Processing...'); | |
$.post('update.cfc?method=UpdateMethod&returnFormat=plain', | |
$("##ValidateForm").serialize(), | |
function(data,ProcessStatus) | |
{ | |
data = $.trim(data) | |
if (data == 'success') | |
{ | |
$("##ProcessStatus").html('Record Insert Successfully'); | |
} | |
}); | |
return false | |
} | |
$(document).ready(function() | |
{ | |
$("##ValidateForm").validate( | |
{ | |
rules: | |
{ | |
FirstName: {required: true}, | |
EmailID:{required:true,email:true}, | |
ContactNo:{required:true} | |
}, | |
messages: | |
{ | |
FirstName: ' **', | |
EmailID: ' **', | |
ContactNo: ' **' | |
}, | |
submitHandler: function(form) | |
{ | |
$(form).ajaxSubmit(ProcessValidateForm); | |
} | |
}); | |
}); | |
</script> | |
<script type="text/javascript"> | |
function intOnly(i) | |
{ | |
if (i.value.length > 0) | |
{ | |
i.value = i.value.replace(/[^\d]+/g, ''); | |
} | |
} | |
</script> | |
<form id="ValidateForm"> | |
<table width="990" border="0" cellpadding="0" cellspacing="10" bordercolor="Red"> | |
<tr> | |
<td></td> | |
<td><div id="ProcessStatus"></div></td> | |
</tr> | |
<tr> | |
<td width="120" class="TableText" align="right" valign="middle">First Name: *</td> | |
<td><input type="text" name="FirstName" id="FirstName" value="" Class="TableText" size="35"></td> | |
</tr> | |
<tr> | |
<td width="120" class="TableText" align="right" valign="top">Email ID: *</td> | |
<td><input type="text" name="EmailID" id="EmailID" value="" size="35"></td> | |
</tr> | |
<tr> | |
<td class="TableText" align="right" valign="top">Country: </td> | |
<td><input type="text" name="Qualification" id="Qualification" value="" Class="TableText" size="35"> </td> | |
</tr> | |
<tr> | |
<td class="TableText" align="right" valign="middle" width="120">Contact No: *</td> | |
<td><input type="text" maxlength="10" id="ContactNo" name="ContactNo" value="" size="35" onKeyUp="javascript:intOnly(this);"> | |
</td> | |
</tr> | |
<tr> | |
<td></td> | |
<td align="left"><input type="submit" value="S U B M I T" /></td> | |
</tr> | |
</table> | |
</form> | |
</cfoutput> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment