3

I have a JSP page, which accepts user strings in more than 23 languages. So an English speaking user writes 8.5, and the JavaScript function should accept it as well as the input 8,5 from a Russian user.

In this scenario, how do we validate the input in JavaScript for all the languages?

Sebastian Zartner
  • 18,808
  • 10
  • 90
  • 132
GustyWind
  • 3,026
  • 3
  • 41
  • 50
  • My idea is first get the locale value then the number format value and then validate with user input and if matches return appropriate vale.I think I need a snippet for this . – GustyWind Jun 01 '09 at 10:10

1 Answers1

2

You can probably do this server side with Java using java.text.NumberFormat, but Dojo has code to do this client side. See dojo.number and dijit.form.NumberTextBox which uses dojo.number.

peller
  • 4,435
  • 19
  • 21