Skip to content
Browse files

Merge pull request #1530 from rawtaz/clientChangeSubmitDocFix

Document the 'submit' option in CHtml::clientChange() better.
[ci skip]
  • Loading branch information...
2 parents a793880 + 5d30e12 commit be5241d0bba1e6a9176043b024ab345922bba1e8 @mdomba mdomba committed
Showing with 6 additions and 2 deletions.
  1. +6 −2 framework/web/helpers/CHtml.php
8 framework/web/helpers/CHtml.php
@@ -2042,9 +2042,13 @@ public static function listOptions($selection,$listData,&$htmlOptions)
* @param array $htmlOptions HTML attributes which may contain the following special attributes
* specifying the client change behaviors:
* <ul>
- * <li>submit: string, specifies the URL that the button should submit to. If empty, the current requested URL will be used.</li>
+ * <li>submit: string, specifies the URL to submit to. If the current element has a parent form, that form will be
+ * submitted, and if 'submit' is non-empty its value will replace the form's URL. If there is no parent form the
+ * data listed in 'params' will be submitted instead (via POST method), to the URL in 'submit' or the currently
+ * requested URL if 'submit' is empty. Please note that if the 'csrf' setting is true, the CSRF token will be
+ * included in the params too.</li>
* <li>params: array, name-value pairs that should be submitted together with the form. This is only used when 'submit' option is specified.</li>
- * <li>csrf: boolean, whether a CSRF token should be submitted when {@link CHttpRequest::enableCsrfValidation} is true. Defaults to false.
+ * <li>csrf: boolean, whether a CSRF token should be automatically included in 'params' when {@link CHttpRequest::enableCsrfValidation} is true. Defaults to false.
* You may want to set this to be true if there is no enclosing form around this element.
* This option is meaningful only when 'submit' option is set.</li>
* <li>return: boolean, the return value of the javascript. Defaults to false, meaning that the execution of

0 comments on commit be5241d

Please sign in to comment.
Something went wrong with that request. Please try again.