API, Error checking and check boxes

API, Error checking and check boxes

I cannot seem to get form validation to work for checkboxes in the website using the API.

If run the form inside Zoho Creator, it runs my error checking and alert boxes. It does not do so from the website, even though it is on the submit button. 

This is the code I have on add > validate
  1. if (input.EggDishes.size()  >  1)
  2. {
  3.     alert("Only one option is permitted");
  4. }
My goal is to limit to only one out of two selections. I don't want to use a radio button because I have fields where I will need to ensure 3 /5 or 2/3. So, I need to get this working.

Ironically if I make the field mandatory, that error checking does go through to the webpage.

Any thoughts?