• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

to check double values

 
Debashree Halder
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to check whether the entered value in a textbox is an integer or double value. How can I check this?

[Bear edit: fixed typo in subject: check is not spelled chk]
[ September 28, 2005: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65119
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The value entered into a text box is always a string. Are you asking how to convert this string into int or double values?
 
sandeep TA
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes it will be stored as string


for double conversion

Double.getDouble(str)
 
Debashree Halder
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually I want to use keyPress function.

If user presses any thing other than 0-9 and decimal point (.) it will show an alert box telling "You can only enter numbers".

How can I achieve this?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65119
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is a client-side activity that you must use Javascript for.

Moved to the HTML/Javascript forum.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic