Copy link to clipboard
Copied
I have set several fields in my form to required. If the field is not completed upon submission the Adobe acrobat error message appears stating that at least one field is empty.
Is there a way to specify which fields are empty? Specify a list of empty fields the user needs to go back and complete? Instead of just a general statement.
If so how would I go about doing that? This is my 1st form I am completing.
Copy link to clipboard
Copied
Check the JS Console after clicking one of those check-boxes...
Copy link to clipboard
Copied
Okay,
I've spent hours trying to figure out why the grant field will not validate. I looked at the JavaScript I'm not sure what I'm even looking for. I erased every reference in the JavaScript that referenced the grant field and not to work. Even when it was erased some of the commands still worked. Not sure why that happened. Any suggestions would be greatly appreciated. I am so close to getting this exactly how I need it.
Copy link to clipboard
Copied
This is the error message I'm getting:
TypeError: this.getField("grayimage") is null
16:Field:Mouse Up
It happens because there's no field with that name, and it causes the rest of the code to not work.
Copy link to clipboard
Copied
Hi,
I've used the code below which works fine, this was taken from the code discussion above, all works fine apart from the email doesn't show the subject line, any help appreciated. Thanks Paul
// This is the form return e-mail. Its hardcoded // so that the form is always returned to the same address // Change address on your form var cToAddr = "Colette.Williams@sjp.co.uk"; var cCCAddr = "" // Set the subject and body text for the e-mail message var cSubLine = "St. James's Place PC Consultancy Request Form"; var cBody = ""; 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.defaultValue==f.valueAsString) emptyFields.push(f.name); } } if (emptyFields.length>0) { app.alert("Error! You must fill in the following fields:\n" + emptyFields.join("\n")); } else this.mailDoc({cTo: "Colette.Williams@sjp.co.uk"});
Copy link to clipboard
Copied