dskaushik5, I can spot a few syntax errors:
- missing semicolon after alert() and on the last line
- two of the 'if' statements should probably be 'for' statements
In addition, there are a whole lot of logical errors! For example, 'priceValue.charAt(i)!= char.charAt(j);' won't do anything, so the code will probably just give you the alert 12x(length of input string) times, no matter what the input string was. What you probably meant was to put the 'priceValue.charAt(i)!= char.charAt(j);' in an 'if' statement, but that won't work. For example, if the string you are testing is 23.17, your code will test whether '0' is not equal to '2', and then fire the alert, even though 2 is a perfectly legal digit. Try do a walk-through with pen and paper of your code to debug it (i.e. pretend you are a computer...).
There are many ways to skin a cat. The way I'd go would be to define a regular expression, and test: