Link to home
Start Free TrialLog in
Avatar of Satyaveni Garalanka
Satyaveni Garalanka

asked on

Validation of number with dots and commas only

I have to validate a text field in which only numbers,dots and commas are allowed. Apart from these 3 if I input others then it should throw error.
Pls suggest
Avatar of Swatantra Bhargava
Swatantra Bhargava
Flag of India image

var regex = /^[0-9.,]+$/;
  if( !regex.test(key) ) {
    return false;
  }

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial