Hello,
I run the following javascript when a form is submitting within my app. It is to check whether the required fields have been completed. It does not work... Whether data is entered or not in a field I always get the alert displayed. I'm an amateur so any help would be greatly appreciated.
---------------------------------var Person = Apperyio('people_lookup').val();
var Brand = Apperyio('select_brand').val();
var Type = Apperyio('select_clothing').val();
var Size = Apperyio('enter_size').val();
var errorMsg = "";
if ($.trim(Person) === "");
{
errorMsg = errorMsg + "Person is a required field \n";
}
if ($.trim(Brand) === "");
{
errorMsg = errorMsg + "Brand is a required field \n";
}
if ($.trim(Type) === "");
{
errorMsg = errorMsg + "Type of clothing is a required field \n";
}
if ($.trim(Size) === "");
{
errorMsg = errorMsg + "Size is a required field \n";
}
if (errorMsg === "")
{ Create_Size_Record.execute ({});
Apperyio.navigateTo('MySizeIn', {transition : 'slideup'});
} else
{ alert ("Please correct the following issues: \n" +errorMsg);
}