File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes entered percentage value validation in javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "entered percentage value validation in javascript" Watch "entered percentage value validation in javascript" New topic
Author

entered percentage value validation in javascript

rammie singh
Ranch Hand

Joined: Mar 26, 2009
Posts: 116
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

Joined: Jan 10, 2002
Posts: 60046
    
  65

Java or JavaScript? Make up your mind.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
rammie singh
Ranch Hand

Joined: Mar 26, 2009
Posts: 116
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

Joined: Jan 10, 2002
Posts: 60046
    
  65

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

Joined: Mar 26, 2009
Posts: 116
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

Joined: Oct 05, 2009
Posts: 121

Hi Rammie Singh,

if you dont mind, can you explain more clearly what do you exactly need???


Sun Certified Java Programmer with 93 percent
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60046
    
  65

You seem to have forgotten to post your code.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286
    
    6

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.


GenRocket - A Test Data Generation Platform
salvin francis
Ranch Hand

Joined: Jan 12, 2009
Posts: 917

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...

My Website: [Salvin.in] Cool your mind:[Salvin.in/painting] My Sally:[Salvin.in/sally]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: entered percentage value validation in javascript
 
Similar Threads
How to Extract value of 'Percentage' into some variable for comparing.
adding double values
scbcd 5 beta exam analysis ..
Near to the Exam date
How to retrieve string representation of <INPUT> value?