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

Question

Question

Forms jquery - .change() on a regular expression conditioned field

asked on April 7, 2023

Any reason why regular expression conditions do not trigger when using the .change() jquery method.

The user must manually enter invalid data for the condition to trigger a warning.

Typically I always use .change() to represent any sort of change I want field rules, lookup rules, conditions, or any other criteria to be aware of.

The use case
We want to prevent the user from submitting when a lookup returns a certain value, but the lookup was returning to a multi-line field (and needs to because it carries information for the submitter to review) and there was no condition option under advanced on that field type.

We tried referencing the multi-line field as a variable, to copy the information to a single line type field but variable values do not update in real time, so we synced the data to a single line field with script instead.

0 0

Answer

SELECTED ANSWER
replied on April 7, 2023 Show version history

This does not trigger the Parsley validator.

After your change event, try

 

$('#q5 input').val('123145555');
$('#q5 input').change();
$('#q5 input').parsley().validate();

 

2 0
replied on April 10, 2023

Thank you!

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.