javascript - Check for comma in textbox using jQuery -


How to check commas in the text box, of course If comma is present, the code should be alerted,

  & lt; Input type = "text" id = "name" />  

Thank you ..

You can: < / P>

  if ($ ('$ name'). Val (). IndexOf (',') == -1) {Warning ('was a comma'); }  

As you have not specified, you can insert that code in Blur event and so on.


Comments