38
Views
3
Comments
Input box with Uppercase and Not Allow Special Character on Javascript OnKeyUp

document.getElementById("txtName").value =  document.getElementById("txtName").value.replace(/[^a-zA-Z0-9 ]/g, '').toUpperCase();



Post1.png
Post2.png
2022-01-13 11-06-04
Neha Sheikh
Champion

Hello,

You can do that as done in the below OML.

Let me know if you have any questions.

Thanks,

Neha

TestApp.oml
2024-05-22 06-12-56
Vignesh Prakash

Hi Vivekanandan Kulandasamy, 

The script you shared above is working as expected, do you face any issues while using them?

Thanks,
Vignesh Prakash.

2023-02-09 12-36-42
Damian Fonville

To correctly use the Javascript, you should have a Javascript input value and an output value, 

The input is the Local variable of the input field, and you can use the javascript output to the same value. It's best not to use document.getElementById, since outystems generates the code, en the Id could differ each render. 




Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.