i have a script to check the fields in a document to see if they are filled out or not.
it returns the fields that are incomplete. the full code is:
var emptyFields = [];
for(var i = 0;i<this.numFields;i++)
{var f = this.getField(this.getNthFieldName(i));
if(f.type!="button"&&f.required)
{if((f.type=="text"&&f.value==""))emptyFields.push(f.name);}}
if(emptyFields.length > 0)
{app.alert("You Must Fill In The Following Required Fields:\n" + emptyFields.join("\n"));}
else f.readonly = true;
now, what i want it to do is, if there are any missing fields, it will stop the document from saving/save as/print.
and if everything is filled out, it will save/save as/print as a read only document.
right now, i have this code under "Document will save"
currently, the alert pops up, but still saves the document anyway.
on a side note, is it possible to make the red borders on the required fields dissappear?
any and all help would be appreciated.
thanks!