Skip to main content
July 13, 2016
Question

SubmitForm vs MailDoc

  • July 13, 2016
  • 3 replies
  • 660 views

I have a PDF form that is being submitted via email.  We want a number of fields to be required.  I initially set up the form with a button to submit the form using the action 'Submit a Form'.  Using that button would check that the required fields all contained data.

However, we wanted to customize the email that was generated to include a subject line and message that was based upon the contents of the pdf, so I went away from using the 'Submit a Form' action and used a script that called MailDoc.  However, now the required fields are not validated before the email is sent.

How can I validate the required fields as well as send the customized email?

This topic has been closed for replies.

3 replies

NKOWA555
Inspiring
July 13, 2016

Question: How can I validate the required fields as well as send the customized email?

Answer: You can submit to a server-side script using a normal submit button which validates the required fields and emails the form submission without client side email software. ASP.net scripts can parse the submission data using iText technologies and customize the to, cc, bcc, subject, body and attachment file name.

Visit the following website for an online examples:

www.pdfemail.net/examples/

Inspiring
July 13, 2016

The required field property and submit work for web pages but not user friendly. It is better to write a custom script to validate that the required fields are completed and provide a more user friendly interaction.

You can write a custom JavaScript button that checks the required fields are completed before carrying out the submit action or not.

Custom JavaScript requires you put the various JavaScript statements to perform the process you want done. You can read each field and test the "Required" property. If it is a required field, you can then compare the default value and the value of the field. If they are equal, then the form field has not been completed and you need to keep track of this fact.

There have been many questions and replies about this topic. You can use the search feature of this site to find them.

try67
Community Expert
Community Expert
July 13, 2016

You'll need to perform the validation yourself, using a script.

Over the years I posted the code that does that many times on these forums... Search for "required fields validation" and you'll find it for sure.