How to allow numbers, backspace, delete, left and right arrow keys in the text control of IBM BPM or Input string of Brazos

362 views Asked by At

Hi I want restrict to unwanted characters like not able to allow characters and special characters only allow to numbers and left,back,backspace and delete. for that requirement i need to pass below code in input field

  onkeypress="return (event.which >= 48 && event.which <= 57) ||
 event.which == 8 || event.keyCode == 46 || event.keyCode == 37 ||
 event.keyCode == 39" maxlength="12"

I am trying to keep the above code in HTML attributes but it not going to place in input field.

so please any body can help me out this requirement how to achieved.

1

There are 1 answers

0
tlano On

It would be helpful to know the use case, but it sounds like you want the user to only enter number characters with a maximum length of 12. In the "Input String" Control for Brazos UI, there are configuration options called "Input Mask Enabled", and "Input Mask Format". If you enable the first option, you can then fill in your desired pattern in the "Input Mask Format" option. Hovering over the label of this option will show you how to use the patterns.

If the case were, say, exactly 5 number characters, you would write "99999" (without the quotes). If the case were what is described above, up to 12 number characters, you would write "?999999999999" (again, without the quotes).