yii2: javascript form validation trigger the form submition

trying to validate a form with javascript with

$('#order-form').data('yiiActiveForm').submitting = true;
$('#order-form').yiiActiveForm('validate');

when form is

<?php $form = ActiveForm::begin(['id' => 'order-form', 'layout' => 'horizontal']); ?>
// somme fields
<?php ActiveForm::end() ?>

i expect the form to just validate the fields show error messages if any, but instead the form is submited | Yii version | 2.0.10 | PHP version | 7.0.4 | Operating system | Windows

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 15 (10 by maintainers)

Commits related to this issue

Most upvoted comments

@Shaeldon do you know how to fix it properly?

Mabye soon™ ?