Customizing Validation Messages

Whether you want to throw a little more flair into validation messages or simply localize them to your user's region, we've got you covered in this article.  Using our easy javascript syntax you are able to change the text on many different validation messages.
 

Customize via Javascript

In order to customize any of the above validation messages, you will have to create a simple javascript function that will execute as the page is being loaded.  With our Javascript API, the function needed will be OnAfterRender.

To add custom javascript expressions first click the Form Settings button then scroll down to the bottom of the window.  All javascript can be entered into the Javascript Code section.  After you are finished simply click close and publish your form.

Javascript_FormSettings.gif

 

Current Validation Messages

Below is a list of all current validaiton messages within the Formstack Salesforce Application.

  • window.ffErr_SignatureFullNameTyped = 'Please enter your first and last name in the provided field.';
  • window.ffErr_SignatureInitialsTyped = 'Please enter your initials in the provided field.';
  • window.ffErr_SignatureFullNameDrawn = 'Please sign your first and last name in the provided field.';
  • window.ffErr_SignatureInitialsDrawn = 'Please sign your initials in the provided field.';
  • window.ffErr_SignatureDateTyped = 'Please select today\'s date in the provided field.';
  • window.ffErr_SignatureDateDrawn = 'Please sign today\'s date in the provided field.';
  • window.ffErr_SignatureAcceptTerms = 'You must accept the provided terms before continuing.';
  • window.ffErr_SignatureValidEmail = 'Please provide a valid email address.';
  • window.ffErr_FormatValidDecimal = 'Please enter a valid decimal value.';
  • window.ffErr_FormatValidNumber = 'Please enter a valid numeric value.';
  • window.ffErr_FormatDecimalSize = 'Value is too large.';
  • window.ffErr_FormatValidEmail = 'Please enter a valid email address.';
  • window.ffErr_FormatValidPhone = 'Please enter a valid phone number.';
  • window.ffErr_FormatValidUrl = 'Please enter a valid URL.';
  • window.ffErr_InvalidDate = 'Please enter a valid date.';
  • window.ffErr_InvalidDateTime = 'Please enter a valid date time.';
  • window.ffErr_FileUploadSize = 'Maximum file size is 2.5 MB';//TODO: Rogerio check if it is 5 or 2.5
  • window.ffErr_FileUploadType = 'Only the following file types are allowed: ';
  • window.ffErr_CaptchaIncorrect = 'The text you have entered is incorrect. Please try again.';
  • window.ffPrompt_EnterSaveEmail = 'Please provide your email address below. You will receive an email with a link to allow you to retrieve your saved form at a later date.';
  • window.ffPrompt_SaveEmailConfirm = 'Thank you! You will receive an email shortly with a link to your saved form.';
  • window.ffPrompt_InvalidSavedForm = "The saved form you are attempting to retrieve is invalid or has already been submitted.";
  • window.ffPrompt_SavedFormDiscarded = "Your saved form has been discarded.";
  • window.ffPrompt_SFLChangesSaved = "Your changes have been saved! To retrieve your saved form at any time, simply click on the link provided to you by email.";
  • window.ffPrompt_PaymentInProcessWarning = "Your payment is still being processed. Leaving the page now will cause your payment to not get processed. Are you sure you want to do this?";
  • window.ffPaymentError_InvalidCountry = "Please provide a valid country name";

 

Code Sample:

function FF_OnAfterRender(){
window.ffErr_InvalidDate ='YOUR DATE ERROR';
window.ffErr_FormatValidEmail ='YOUR EMAIL ERROR';
}
Was this article helpful?
1 out of 4 found this helpful

Comments

0 comments

Article is closed for comments.