3
Answers

comma separator in textBox field

I have a textbox with jQuery validations on it
This textBox is not allowing comma in between the values, can someone please help me out
Below is the code

var txtValue = $("#txtValue").val();

txtValue = txtValue.replace(/(^\s*)|(\s*$)/gi, "").replace(/[ ]{2,}/gi, " ").replace(/\n +/, "\n");

var Regex = /^[0-9a-zA-Z-]+$/;

if (!Regex.test(txtValue)) {...

Answers (3)