Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Firefox don't recognize the maxlenght in asp textbox

  • 1 odgovor
  • 2 ima ovaj problem
  • 3 views
  • Posljednji odgovor poslao Matt Brubeck

more options

Greetings, I have developed a asp.net web page has an asp textbox control with the property maxlenght = 2, but when tested with firefox 5.0 on the Samsung Galaxy Tab and enter data, lets you enter more than 2 characters.

So can validate the textbox with a javascript function in onkeypress event of the control.

Below detail the function

acceptNum function (evt) {

    charCode var = (evt.which)? evt.which: event.keyCode
    if (charCode> 31 & & (charCode <48 | | charCode> 57))
        return false;
    return true;

}

Please help.

Greetings, I have developed a asp.net web page has an asp textbox control with the property maxlenght = 2, but when tested with firefox 5.0 on the Samsung Galaxy Tab and enter data, lets you enter more than 2 characters. So can validate the textbox with a javascript function in onkeypress event of the control. Below detail the function acceptNum function (evt) { charCode var = (evt.which)? evt.which: event.keyCode if (charCode> 31 & & (charCode <48 | | charCode> 57)) return false; return true; } Please help.

All Replies (1)

more options

Thanks for the bug report. Can you let us know which keyboard you are using (for example, Swype, SwiftKey, or Samsung Keypad)?

With keyboards that provide suggestions, Firefox may show more than 2 characters while you are still composing a word, but it should cut off any extra characters as soon as you complete the word or move on to the next field.