mirror of
				https://github.com/yiisoft/yii2.git
				synced 2025-11-01 03:26:36 +08:00 
			
		
		
		
	Fix #13105: Add yiiActiveForm validate_only property for skipping form auto-submission
This commit is contained in:
		| @ -4,6 +4,7 @@ Yii Framework 2 Change Log | |||||||
| 2.0.44 under development | 2.0.44 under development | ||||||
| ------------------------ | ------------------------ | ||||||
|  |  | ||||||
|  | - Enh #13105: Add yiiActiveForm validate_only property for skipping form auto-submission (ptolomaues) | ||||||
| - Enh #18967: Use proper attribute names for tabular data in `yii\widgets\ActiveField::addAriaAttributes()` (AnkIF) | - Enh #18967: Use proper attribute names for tabular data in `yii\widgets\ActiveField::addAriaAttributes()` (AnkIF) | ||||||
| - Bug #18798: Fix `StringHelper::dirname()` when passing string with a trailing slash (perlexed) | - Bug #18798: Fix `StringHelper::dirname()` when passing string with a trailing slash (perlexed) | ||||||
| - Enh #18328: Raise warning when trying to register a file after `View::endPage()` has been called (perlexed) | - Enh #18328: Raise warning when trying to register a file after `View::endPage()` has been called (perlexed) | ||||||
|  | |||||||
| @ -218,6 +218,7 @@ | |||||||
|                     attributes: attributes, |                     attributes: attributes, | ||||||
|                     submitting: false, |                     submitting: false, | ||||||
|                     validated: false, |                     validated: false, | ||||||
|  |                     validate_only: false, // validate without auto submitting | ||||||
|                     options: getFormOptions($form) |                     options: getFormOptions($form) | ||||||
|                 }); |                 }); | ||||||
|  |  | ||||||
| @ -754,12 +755,14 @@ | |||||||
|                 data.submitting = false; |                 data.submitting = false; | ||||||
|             } else { |             } else { | ||||||
|                 data.validated = true; |                 data.validated = true; | ||||||
|                 if (data.submitObject) { |                 if (!data.validate_only) { | ||||||
|                     applyButtonOptions($form, data.submitObject); |                     if (data.submitObject) { | ||||||
|                 } |                         applyButtonOptions($form, data.submitObject); | ||||||
|                 $form.submit(); |                     } | ||||||
|                 if (data.submitObject) { |                     $form.submit(); | ||||||
|                     restoreButtonOptions($form); |                     if (data.submitObject) { | ||||||
|  |                         restoreButtonOptions($form); | ||||||
|  |                     } | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|         } else { |         } else { | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 ptolomaues
					ptolomaues