2

I have been using jquery in my web based Asp.net MVC application, and when i use chrome mobile to test my work i found that jquery's functions which are based upon keypress/keyup is not working.

I didn't know why it is not working on mobile browsers. It is working properly on desktop browsers.

Can anyone solve my problem, thanks in advance.

wild coder
  • 880
  • 1
  • 12
  • 18

1 Answers1

0

This worked for me: http://www.dotnetfunda.com/forums/show/8137/onkeyup-event-not-firing-in-firefox-and-chrome

The code:

<textarea name="textarea" id="txtComments" rows="3" onkeyup='return fnMaxLength(this,"5");' style="width: 940px" ></textarea> 

function fnMaxLength(field, maxChars) {

if (field.value.length >= maxChars) { 

    var object = "-More than " + maxChars + " characters have been entered.";

    //errorAlert("error", "Maximum length error", object);

    alert(object);

    return false; 

} 

}