How to check for comma separated values in a text box and raise an alert if not found?
And if there is it should be characters in it like A,B,C,D
function validate()
{
//validate text box;
}
<input type="text" id="val" >A,B,C,D</input>
<input type="button" id="save" onclick="validate()">
/^[A-Za-z](?:,[A-Za-z])*$/.test(document.getElementById("val").value)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With