Registration limit problem

Registration limit problem

I'm trying to create a script where I can limit the number of registrants for each session (dropdown menu selection). I'm trying to copy and paste a script from another discussion (modified for my fields), but it's not working. Please help.

The script error within add - validate is: Encountered "18" at line 1, column 41.
Was expecting one of:
"]" ...
"*" ...




  1. cnt1 = count ( Meeting_Time [ October 18, 6-7 p.m. == input.October 18, 6-7 p.m. ] );
  2. cnt2 = count ( Meeting_Time [ October 18, 7-8 p.m. == input.October 18, 7-8 p.m. ] );
  3. cnt3 = count ( Meeting_Time [ October 21, 6-7 p.m. == input.October 21, 6-7 p.m. ] );
  4. cnt4 = count ( Meeting_Time [ October 18, 7-8 p.m. == input.October 18, 7-8 p.m. ] );
  5. if (cnt1 > 18){alert "October 18, 6-7 p.m. limit is full";cancel submit;}
  6. if (cnt2 > 18){alert "October 18, 7-8 p.m. limit is full";cancel submit;}
  7. if (cnt2 > 18){alert "October 21, 6-7 p.m. limit is full";cancel submit;}
  8. if (cnt2 > 18){alert "October 18, 7-8 p.m. limit is full";cancel submit;}