I simply want to notify a user that a required field is blank when they print or save the PDF.
if (aField.value == "") // empty field
var msg = "No Required fields can be left empty.";
} // end of function
However, when I leave a required field blank, I don't receive the message.
Thanks for any assistance,
That function is only a part of a script that you'd use for this. The function is passed an array of field objects and checks each one. So additional code you'd need would be code to create an array of field objects, code to call that function, and code that looks at the return value and does something based on its value. I suspect the thread that you got this code from will include this.
You will have to "walk" the array or run the test on each element of the array of field objects. You should change your code to return the result from testing all of the fields and not just an individual field.
Also you may need to check that the field is field that can be tested for the "required" property and for some fields like check boxes or radio buttons you may need to perform some additional test.