Skip to content

Manually trigger input validation

Geremia Taglialatela edited this page Jun 17, 2016 · 12 revisions

Use the following "script":

$input = $('#validated_input')
$form = $input.closest('form')

$input.data('changed', true)
$input.isValid($form[0].ClientSideValidations.settings.validators)

It might not work for multiple inputs selected at once by $input.

It also works with the whole form by calling $form.isValid(...) instead.

Gem version 3.2.7, 4.2.4