The count function returns the number of rows in a Form / Form variable.
count(formname[<expression>])
on success
{
if (count(team_member[name == input.name]) > 0)
{
cancel submit;
}
}
where,
team_member - is the name of the form.
team_member [name == input.name] - selects all the team_members whose name is equal to the name currently entered in the name field.
input.name - it is the value for the field "name" given by the user while submitting the form
count - count operator returns the number of team members whose name is equal to input.name
on success
{
if(count(Employee)>= 20)
{
alert("No more registrations allowed");
cancel submit;
}
}
where,
Employee - is the name of the form
count - count function returns the number of records in the Employee form.
on success
{
var1 = count(FormA[ID!=0 ]);
info var1;
}