You are viewing limited content. For full access, please sign in.

Question

Question

Validation Message Language

asked on November 21, 2016

Hi, we have a single Laserfiche form where the language can be changed using a querystring parameter, however we are struggling with replacing the validation messages with the relevant language.  For example, if the form is in simplified Chinese and a group of fields is set to required, if the field does not get filled in than the validation message 'Please fill out this field' should be replaced by the simplified Chinese version entirely.

 

So far we have tried the following code but the text does not get changed.

$('#Field118').siblings('.ws-errorbox').find('.ws-errormessage').text("请填写");

Also ideally we would like to replace all the validation message with a single generic message rather than having to specify each field ID as per the above code. Can anyone point me in the right direction? Thanks

0 0

Answer

SELECTED ANSWER
replied on November 22, 2016 Show version history

The validation message is from Webshim, and the validation message would change based on the browser locale. You can refer to the document http://afarkas.github.io/webshim/demos/demos/forms.html

If you want to manually control validation message, you can set customized error message with data-errormessage attribute.

For example, add the following to Forms custom script:

$(function () {
  $("input").attr('data-errormessage','{"valueMissing": "请填写1"}');
  $("textarea").attr('data-errormessage','{"valueMissing": "请填写textarea"}');
  $("select").attr('data-errormessage','{"valueMissing": "请填写2"}'); 
});

 

0 0
replied on November 22, 2016

That works! Thanks for your advice Rui.

We have notice the webshim version Laserfiche is currently using is 1.12.7, one of the language we require is zh-TW and it was added in version 1.14.3. Is there any plans to update the webshim version in future Forms release or is there any way we can manually update Forms so it uses the latest webshim version 1.16.0?

0 0
replied on November 22, 2016

Never mind, managed to update it manually by modifying the webshim js file.

Many thanks for your help.

0 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.