Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

entered percentage value validation in javascript

 
rammie singh
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi every body...
can any one provide me the link or code for validating input percentage value in javascript...as i am finding it difficult to get on internet. I am using java.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65220
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java or JavaScript? Make up your mind.
 
rammie singh
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..

i meant..that i am using javascript in java(Jsp and servlet) not in something like.... .net,or php etc.

Any way i definately need javascript help here.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65220
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's on the server is moot.

So what's the real problem? What do you mean by validating a percentage? Just making sure it's between 0 and 100? Something else?

Attention to detail!
 
rammie singh
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes ..i want that this percentage box has value ranging between 0 and 100 and it can accepts both float and numbers.
 
suresh dasari
Ranch Hand
Posts: 121
Chrome Eclipse IDE Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rammie Singh,

if you dont mind, can you explain more clearly what do you exactly need???
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65220
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You seem to have forgotten to post your code.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just did a google search for "javascript validate percentage" and the results were bountiful. And in reality what you really want to do is validate a number >=0 and <= 100.
 
salvin francis
Bartender
Posts: 1309
10
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gregg Bolinger wrote:I just did a google search for "javascript validate percentage" and the results were bountiful. And in reality what you really want to do is validate a number >=0 and <= 100.


Lets settle on the facts:

1. validate a number. I think parseInt(); is the method for that.
2. check its value between 0 to 100 simple if condition.

Let us know if it helps...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic