Prevent "Send Email" dialog until required fields are completed
i'm new js, & struggling 1 last piece of code.
i have form several required fields. sending form email attachment , need required fields completed before form can emailed.
currently, have alert box display if of required fields blank, if cancel alert box, "send email" dialog pops right away , can email form if required fields blank. want "send email" box appear after required textboxes completed.
the problem seems if/else line (if req. fields blank, send alert. else open "send email" box). what’s best way write this? ideally, i'd alert list specific fields blank. here's have @ moment - have wrong):
if (requiredfields.length > 0) {
app.alert(error);
} else
var subject = this.getfield("jobnumber").value + " -- request form";
this.maildoc({
cto: "me@mycompany.com",
})
(using acrobat xi - in advance!)
your call of maildoc after if/else statement.
use this:
if (requiredfields.length > 0) {
app.alert(error);
} else {
var subject = this.getfield("jobnumber").value + " -- request form";
this.maildoc({
cto: "me@mycompany.com",
})
}
More discussions in JavaScript
adobe
Comments
Post a Comment