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
- Fixed #14186, fixed #14510 - forced validation regression (caused by #13105 fix) — committed to yiisoft/yii2 by arogachev 7 years ago
- (#13105) Add yiiActiveForm validate_only property for skipping form auto-submission JS validation example: form = $('#someForm'); form.data('yiiActiveForm').validate_only = true; form.one('afterVali... — committed to ptolomaues/yii2 by deleted user 3 years ago
- (#13105) Add yiiActiveForm validate_only property for skipping form auto-submission JS validation example: form = $('#someForm'); form.data('yiiActiveForm').validate_only = true; form.one('afterVali... — committed to ptolomaues/yii2 by deleted user 3 years ago
- Merge pull request #2 from yiisoft/master Fix #13105: Add yiiActiveForm validate_only property for skipping for… — committed to sakibguy/yii2 by sakibguy 3 years ago
- merge upstream (#3) * Added missing note for $categoryMap (#18834) * fix invalid link & update (#18835) * Fix #18823: Rollback changes #18806 in `yii\validators\ExistValidator::checkTargetRelat... — committed to yus-ham/yii2 by yus-ham 2 years ago
- merge upstream (#4) * Added missing note for $categoryMap (#18834) * fix invalid link & update (#18835) * Fix #18823: Rollback changes #18806 in `yii\validators\ExistValidator::checkTargetRelat... — committed to yus-ham/yii2 by yus-ham 2 years ago
- Fix #13105: Add yiiActiveForm validate_only property for skipping form auto-submission — committed to maxodrom/yii2 by ptolomaues 3 years ago
@Shaeldon do you know how to fix it properly?
Mabye soon™ ?