I have an ASP.NET MVC Page along with Zipcode, Phonenumber & Fax.
Now i want to disable all other keys and only enable digits from the keyboard while typing on these textboxes.
Appreciate your responses.
As of now this is how the form is validated using Validation Plugin.
Zip*
<td CssClass="Form_Value"><%= Html.TextBox("ZipCode", Model.AddressDetail.FirstOrDefault().ZipCode, new { @class = "required zip", minlength = "5"})%></td></tr>
$(“#frmCustDetails”).validate({
rules: {
ZipCode: {
required: true, digits: true, minlength: 5, maxlength: 9
},
messages: {
ZipCode: {
required: "please enter zipcode", digits: "please enter only digits", minlength: "Min is 5", maxlength: "Max is 9
}
});
You can use a mask plugin, like this one. You should still validate it thought, both one the client side and on the server side.