-4

My entire project submission is pending only because of this one issue.I have used all validation in jquery form so that i could be fast and good for the use but i am stuck in this.could you please help me out in this issue.

saika
  • 1
  • 1

2 Answers2

0

Try the jQuery validate plugin : http://docs.jquery.com/Plugins/Validation/Methods/number

PeterFour
  • 329
  • 4
  • 16
0

I handled this issue in 2 ways.

1) User can enter characters also but on submission time user will get alert like 'Value should be a numeric'

2) Not allow user to enter character in text field

Example is http://jsfiddle.net/2dJAN/25/

<input type="text" id ="fax_field" name="fax_field"/>



$("#fax_field").keyup(function(event) {
        var limitField = $(this).val().trim().length;
        this.value = this.value.replace(/[^0-9_\-\.]/g, '');    
});
vinothini
  • 2,606
  • 4
  • 27
  • 42