I may have misunderstood your question, but this will count commas in a
string:

val.split(",").length-1;

JK

-----Original Message-----
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Hinch
Sent: Tuesday, July 15, 2008 8:38 AM
To: jQuery (English)
Subject: [jQuery] Counting commas and form inputs


I'm looking for a way to simply count or limit the number of commas
used.

In my form there is a drop down that selects numbers. This needs to
correspond to the amount of tags a user can input - separated by
commas.

The drop down does several other things already so I just need to know
how to count commas - too many, don't submit the form.

I have got no where with this little task so far =(

Reply via email to