Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,363,383
Community Members
 
Community Events
168
Community Groups

my code not working on chrome mobile but all browser working


<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<input id="ItemName" type="text" />
<script>
$('#ItemName').keypress(function (e) {
var txt = String.fromCharCode(e.which);
if (txt.match(/[>&.&<>/]/)) {
return false;
}
});
</script>

2 answers

Use "keydown" instead of "keypress"

0 votes
DPK J Community Leader Mar 03, 2020

@mukesh singh  Welcome to the community!

Although this is not right space. But still let me help you.

There certainly some issue with 'keypress' event on Android browser (i.e. chrome mobile). Try replacing it with 'keydown' event, this usually works fine.

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events