当前位置: 首页>>代码示例>>PHP>>正文


PHP JavaScriptHelper::event方法代码示例

本文整理汇总了PHP中JavaScriptHelper::event方法的典型用法代码示例。如果您正苦于以下问题:PHP JavaScriptHelper::event方法的具体用法?PHP JavaScriptHelper::event怎么用?PHP JavaScriptHelper::event使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JavaScriptHelper的用法示例。


在下文中一共展示了JavaScriptHelper::event方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: observeForm

/**
 * Observe entire form and call ajax on change.
 *
 * Like @see observeField(), but operates on an entire form identified by the
 * DOM ID <b>form</b>. <b>options</b> are the same as <b>observeField</b>, except
 * the default value of the <i>with</i> option evaluates to the
 * serialized (request string) value of the form.
 *
 * @param string $form DOM ID of form to observe
 * @param array $options ajax options
 * @return string ajax script
 */
	function observeForm($form, $options = array()) {
		if (!isset($options['with'])) {
			$options['with'] = "$('#$form').serialize()";
		}
		$callback = $this->remoteFunction($options);
		return $this->Javascript->event("'#{$form} input, #{$form} select, #{$form} textarea'", "change", $callback);
	}
开发者ID:robksawyer,项目名称:FIND---GET---MAKE,代码行数:19,代码来源:ajax.php

示例2: submit

 /**
  * Returns a button input tag that will submit using Ajax
  *
  * Returns a button input tag that will submit form using XMLHttpRequest in the background instead
  * of regular reloading POST arrangement. <i>options</i> argument is the same as
  * in AjaxHelper::form().
  *
  * @param string $title Input button title
  * @param array $options Callback options
  * @return string Ajaxed input button
  * @see AjaxHelper::form()
  * @link http://book.cakephp.org/1.3/en/The-Manual/Core-Helpers/AJAX.html#submit
  */
 function submit($title = 'Submit', $options = array())
 {
     $htmlOptions = $this->__getHtmlOptions($options);
     $htmlOptions['value'] = $title;
     if (!isset($options['with'])) {
         $options['with'] = 'Form.serialize(Event.element(event).form)';
     }
     if (!isset($htmlOptions['id'])) {
         $htmlOptions['id'] = 'submit' . intval(mt_rand());
     }
     $htmlOptions['onclick'] = "event.returnValue = false; return false;";
     $callback = $this->remoteFunction($options);
     $form = $this->Form->submit($title, $htmlOptions);
     $script = $this->Javascript->event('"' . $htmlOptions['id'] . '"', 'click', $callback);
     return $form . $script;
 }
开发者ID:geethuann,项目名称:assignment3,代码行数:29,代码来源:ajax.php


注:本文中的JavaScriptHelper::event方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。