AnsweredAssumed Answered

Limit size of numeric fields in widget geoprocessing with javascript mask

Question asked by gilbertorm83@gmail.com on Dec 15, 2016

Hello!

 

I need to limit the size of the longitude and latitude fields of a geoprocessing widget I have customized. I need to have a maximum of 6 decimal places, and only typing numbers, comma, and the hyphen character should be allowed.

 

I tried to use a javascript function that I developed, but I can not run it inside the widget, such as onkeypress = "myFunction ()". I always get an invalid template error message.

 

I've also tried using the code below, but it does not limit the amount of characters at the time of typing, ie I need to block typing the seventh decimal place.

 

Any tips on how I can do this?

 

Thank you!
Gilberto.

Outcomes