- Mark as New
- Follow
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
It's ok - I've sorted it!
Turns out that as my reqFieldsList was a string, the objects saved in there that I was trying to reference would have been strings, hence none of the commands I set for them would work.
I have now created an array - var reqFieldsArr = new Array();
Pushed each required field object into it - reqFieldsArr.push(requiredFieldObject);
Then looped through them at the end -
if
(reqFieldsArr != null)
{
var counter = reqFieldsArr.length;
var firstField;
for (var f=0; f<counter; f++)
{
highlightErrors(reqFieldsArr[f]);
if (f == 0)
{firstField
= reqFieldsArr[f];}
}
xfa.host.messageBox('A number of mandatory fields have not been completed. Please check through the form and complete the highlighted fields');
xfa.host.setFocus(firstField);
return false;
}
else
{
return true;}
Might help someone else.....
Views
Replies
Total Likes