mirror of
				https://github.com/yiisoft/yii2.git
				synced 2025-10-31 10:39:59 +08:00 
			
		
		
		
	Fix #13105: Add yiiActiveForm validate_only property for skipping form auto-submission
This commit is contained in:
		| @ -218,6 +218,7 @@ | ||||
|                     attributes: attributes, | ||||
|                     submitting: false, | ||||
|                     validated: false, | ||||
|                     validate_only: false, // validate without auto submitting | ||||
|                     options: getFormOptions($form) | ||||
|                 }); | ||||
|  | ||||
| @ -754,12 +755,14 @@ | ||||
|                 data.submitting = false; | ||||
|             } else { | ||||
|                 data.validated = true; | ||||
|                 if (data.submitObject) { | ||||
|                     applyButtonOptions($form, data.submitObject); | ||||
|                 } | ||||
|                 $form.submit(); | ||||
|                 if (data.submitObject) { | ||||
|                     restoreButtonOptions($form); | ||||
|                 if (!data.validate_only) { | ||||
|                     if (data.submitObject) { | ||||
|                         applyButtonOptions($form, data.submitObject); | ||||
|                     } | ||||
|                     $form.submit(); | ||||
|                     if (data.submitObject) { | ||||
|                         restoreButtonOptions($form); | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|         } else { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 ptolomaues
					ptolomaues