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


PHP CHtml::ajaxSubmitButton方法代码示例

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


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

示例1: render

 /**
  * Returns this button.
  * @return string the rendering result
  */
 public function render()
 {
     $attributes = $this->attributes;
     if (isset(self::$coreTypes[$this->type])) {
         $method = self::$coreTypes[$this->type];
         if ($method === 'linkButton') {
             if (!isset($attributes['params'][$this->name])) {
                 $attributes['params'][$this->name] = 1;
             }
         } elseif ($method === 'htmlButton') {
             $attributes['type'] = $this->type === 'htmlSubmit' ? 'submit' : ($this->type === 'htmlReset' ? 'reset' : 'button');
             $attributes['name'] = $this->name;
         } else {
             $attributes['name'] = $this->name;
         }
         if ($method === 'imageButton') {
             return CHtml::imageButton(isset($attributes['src']) ? $attributes['src'] : '', $attributes);
         } elseif ($method === 'ajaxSubmitButton') {
             //no work
             return CHtml::ajaxSubmitButton('Submit', '/', array('type' => 'POST', 'update' => '#needForm'), array('type' => 'submit'));
         } else {
             return CHtml::$method($this->label, $attributes);
         }
     } else {
         $attributes['name'] = $this->name;
         ob_start();
         $this->getParent()->getOwner()->widget($this->type, $attributes);
         return ob_get_clean();
     }
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:34,代码来源:FormButtonElement.php

示例2: ajaxSubmitButton

 public static function ajaxSubmitButton($label, $url, $ajaxOptions = array(), $htmlOptions = array())
 {
     if (self::getJValidateInstance()->isEnabled()) {
         list($label, $htmlOptions) = self::getJValidateInstance()->ajaxSubmitButton($label, $url, $ajaxOptions, $htmlOptions);
         return parent::button($label, $htmlOptions);
     } else {
         return parent::ajaxSubmitButton($label, $url, $ajaxOptions, $htmlOptions);
     }
 }
开发者ID:schyzoo,项目名称:YiiBoilerplate,代码行数:9,代码来源:EHtml.php

示例3: ajaxSubmitButton

 /**
  * Generates a push button that can submit the current form in POST method.
  * @param string $label the button label
  * @param mixed $url the URL for the AJAX request. If empty, it is assumed to be the current URL. See {@link normalizeUrl} for more details.
  * @param array $ajaxOptions AJAX options (see {@link ajax})
  * @param array $htmlOptions additional HTML attributes. Besides normal HTML attributes, a few special
  * attributes are also recognized (see {@link clientChange} and {@link tag} for more details.)
  * @return string the generated button
  */
 public static function ajaxSubmitButton($label, $url, $ajaxOptions = array(), $htmlOptions = array())
 {
     if (isset($htmlOptions['id'])) {
         $id = $htmlOptions['id'];
         $cs = Yii::app()->getClientScript();
         $cs->registerScript('Yii.HHtml.#' . $id, "jQuery('body').off('click','#{$id}');");
     } else {
         $htmlOptions['id'] = Helpers::GetUniqeId();
     }
     if (!isset($htmlOptions['name'])) {
         $htmlOptions['name'] = Helpers::GetUniqeId();
     }
     return parent::ajaxSubmitButton($label, $url, $ajaxOptions, $htmlOptions);
 }
开发者ID:ahdail,项目名称:humhub,代码行数:23,代码来源:HHtml.php

示例4: updateURLs

    $echoSTR .= "<tr><td>" . $entry['title'] . "</td><td><a href='" . $entry['url'] . "'>Link</a></td></tr>";
}
$echoSTR .= "</table>";
echo $echoSTR;
$saveWidgetHeight = $this->controller->createUrl('/site/saveWidgetHeight');
Yii::app()->clientScript->registerScript('updateURLs', "\n    \$(document).ready(updateURLs());\n    function updateURLs(){\n        \$.ajax({\n            type: 'POST',\n            url: '" . $this->controller->createUrl('/site/getURLs?url=' . Yii::app()->request->requestUri) . "',\n            success:\n            function(data){\n                \$('#sites-box').html(data);\n            }\n        });\n    }\n;\n", CClientScript::POS_HEAD);
Yii::app()->clientScript->registerScript("topSitesResize", "\n\$('#sites-container').resizable({\n    handles: 's',\n    minHeight: 75,\n    alsoResize: '#sites-container, #sites-box',\n    stop: function(event, ui){\n        \$.post('" . Yii::app()->createUrl("/site/saveWidgetHeight") . "',           {Widget: 'TopSites',\n            Height: {topsitesHeight: parseInt(\$('topsites-box').css('height'))}\n            });\n    },\n});\n", CClientScript::POS_HEAD);
?>
</div>
<?php 
echo CHtml::beginForm();
?>
<div id='site-url-container' style="height: <?php 
echo $urlTitleContainerHeight;
?>
px; margin-bottom:35px;">
    Title: <?php 
echo CHtml::textField('url-title', '', array('style' => "height: " . $urlTitleHeight . "px;"));
?>
    <br/>
    Link: <?php 
echo CHtml::textField('url-url', '', array('style' => "height: " . $urlTitleHeight . "px;"));
?>
</div>
<?php 
echo CHtml::ajaxSubmitButton('Add Site', array('/site/addSite'), array('update' => 'site-box', 'success' => "function(response){\n            updateURLs();\n            \$('#url-title').val('');\n            \$('#url-url').val('');\n        }"), array('class' => 'x2-button', 'id' => 'submit-button'));
echo CHtml::endForm();
?>
</div></div></div>

开发者ID:netconstructor,项目名称:X2Engine,代码行数:29,代码来源:topSites.php

示例5: array

            <?php 
echo $form->labelEx($model, 'date', array('class' => 'control-label col-sm-4'));
?>
            <div class="col-sm-8">
                <?php 
echo $form->dateField($model, 'date', array('class' => 'form-control'));
?>
                <?php 
echo $form->error($model, 'date', array('class' => 'text-danger'));
?>
            </div> 
        </div> 

        <div class="form-group">
            <div class="col-sm-8 col-sm-offset-4">
                <?php 
echo CHtml::ajaxSubmitButton("Add", CHtml::normalizeUrl(array('maternalhealth/addtts', 'render' => false)), array('dataType' => 'json', 'success' => 'function(data) {
                        if(data != null && data.status == "success") {
                            $("#tts-dialog").dialog("close");
                            location.reload();
                        }
                    }'), array('class' => 'btn btn-success', 'id' => 'closeTtsDialog'));
?>
            </div> 
        </div> 
    </fieldset>
    <?php 
$this->endWidget();
?>

</div><!-- form -->
开发者ID:rlaput,项目名称:integrated-municipality-management-system,代码行数:31,代码来源:_tetanus_toxoid_status_form.php

示例6: array

                     id="editIco" title="<?php echo Yii::t('module', '0373'); ?>"/>
            </a>
        </div>
    <?php
    }?>
    <a name="list">
    </a>

    <div onclick="showForm();">
        <?php $form=$this->beginWidget('CActiveForm', array(
            'id'=>'ajaxaddlecture-form',
        )); ?>
        <a href="#lessonForm">
            <?php echo CHtml::hiddenField('idmodule', $module->module_ID); ?>
            <?php
            echo CHtml::ajaxSubmitButton('', CController::createUrl('module/lecturesupdate'), array('update' => '#lessonForm'), array('id' => 'addLecture','title'=>Yii::t('module', '0374')));
            ?>
        </a>
        <?php $this->endWidget(); ?>
    </div>
<h2><?php echo Yii::t('module', '0225'); ?></h2>
<?php
$this->widget('zii.widgets.grid.CGridView', array(
    'id'=>'lectures-grid',
    'dataProvider' => $dataProvider,
    'emptyText' => Yii::t('module', '0375'),
    'columns' => array(
        array(
            'class'=>'CButtonColumn',
            'template'=>'{up}{down}{delete}',
            'headerHtmlOptions'=>array('style'=>'display:none'),
开发者ID:nico13051995,项目名称:IntITA,代码行数:31,代码来源:_lectures.php

示例7: array

echo $form->textField($model, 'reason', array('size' => 60, 'maxlength' => 120));
?>
		<?php 
echo $form->error($model, 'reason');
?>
	</div>

	<div class="row buttons">
		<?php 
//echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save');
?>
         <?php 
echo CHtml::ajaxSubmitButton(Yii::t('Attendance', 'Save'), CHtml::normalizeUrl(array('StudentAttentance/EditLeave', 'render' => false)), array('success' => 'js: function(data) {
						$("#td' . $day . $emp_id . '").text("");
						$("#jobDialog123' . $day . $emp_id . '").html("<span class=\\"abs\\"></span>","");
						$("#jobDialog' . $day . $emp_id . '").dialog("close"); window.location.reload();
                    }'), array('id' => 'closeJobDialog' . $day . $emp_id, 'name' => 'save'));
?>
      <?php 
echo CHtml::ajaxSubmitButton(Yii::t('Attendance', 'Delete'), CHtml::normalizeUrl(array('StudentAttentance/DeleteLeave', 'render' => false)), array('success' => 'js: function(data) {
		                $("#td' . $day . $emp_id . '").text(" ");
		                $("#jobDialog' . $day . $emp_id . '").dialog("close"); window.location.reload();
                    }'), array('onClick' => 'return confirm("Are you sure?");', 'id' => 'closeJobDialog1' . $day . $emp_id, 'name' => 'delete'));
?>
	</div>

<?php 
$this->endWidget();
?>
</div>
</div><!-- form -->
开发者ID:SoftScape,项目名称:open-school-CE,代码行数:31,代码来源:_form1.php

示例8: array

echo CHtml::hiddenField("thirdTable", "");
?>
                        <?php 
echo CHtml::hiddenField("thirdFile", "");
?>
                        <?php 
echo CHtml::hiddenField("perRequest", "10000");
?>
                        <div id="importCsvThirdStepResult">
                        	&nbsp;
                        </div> <!-- END div id="importCsvThirdStepResult" -->
                        <div id="importCsvThirdStepColumnsAndForm">
                            <div id="importCsvThirdStepColumns">&nbsp;</div><br/>
                            <?php 
echo CHtml::ajaxSubmitButton(Yii::t('importcsvModule.importcsv', 'Import'), '', array('success' => 'function(response){
										$("#importCsvThirdStepResult").html(response);
										$("html, body").animate({scrollTop:$("#content").position().top}, "slow")
									}'), array("class" => "formbut"));
?>
                        </div> <!-- END div id="importCsvThirdStepColumnsAndForm" -->
                        <?php 
echo CHtml::endForm();
?>
                    </div> <!-- END div id="importCsvThirdStep" -->
                    <br/>
                    <div class="csv_links">
                    <span id="importCsvBread1">&laquo; <?php 
echo CHtml::link(Yii::t('importcsvModule.importcsv', 'Start over'), array("/importcsv"));
?>
</span>
                    <span id="importCsvBread2"> &laquo; <a href="javascript:void(0)" id="importCsvA2"><?php 
echo Yii::t('importcsvModule.importcsv', 'Fields Delimiter') . ", " . Yii::t('importcsvModule.importcsv', 'Text Delimiter') . " " . Yii::t('importcsvModule.importcsv', 'and') . " " . Yii::t('importcsvModule.importcsv', 'Model');
开发者ID:akilraj1255,项目名称:rajeshwari,代码行数:32,代码来源:index.php

示例9: array

														<label class="control-label">原来的密码</label>
														<input type="password" class="form-control" name="oldPasswd" />
													</div>
													<div class="form-group">
														<label class="control-label">新密码</label>
														<input type="password" class="form-control" name ="newPasswd" />
													</div>
													<div class="form-group">
														<label class="control-label">确认密码</label>
														<input type="password" class="form-control" name ="repPasswd" />
													</div>
													<div class="margin-top-10">
														<?php 
echo CHtml::ajaxSubmitButton("保存密码", array("profile/ajaxUpdatePasswd"), array('type' => 'POST', 'update' => '#passwddiv', 'beforeSend' => 'function(){
            $("#passwddiv").html("loading");
            
        }', 'complete' => 'function(){
           // $("#passwddiv").html("complete");
            }'), array("class" => "btn green"));
?>
                                      
														<a href="#" class="btn default">取消</a>
													</div>
												<?php 
$this->endWidget();
?>
</form>
                                                                                        <div class="form-group" id="passwddiv" ></div>
											</div>
											<div id="tab_4-4" class="tab-pane">
												<form action="#" class="">
													<table class="table table-bordered table-striped">
开发者ID:diandianxiyu,项目名称:Yii1.x-admin,代码行数:32,代码来源:index.php

示例10: array

	<?php 
if ($model->alkardex_almacendocs->cestadovale == ESTADO_EFECTUADO and $model->alkardex_almacendocs->almacenmovimientos->signo < 0) {
    ?>
		<div class="row">
			<?php 
    echo CHtml::label('Punto expedicion', 'lblpuntoexped');
    ?>
			<?php 
    $datos1 = CHtml::listData(Puntodespacho::model()->findAll(" codcen='" . $model->codcentro . "'"), 'id', 'nombrepunto');
    echo CHtml::DropDownList('cbopuntoexped', 'codtcentro', $datos1, array('empty' => '--Selecc pto expedicion--'));
    ?>


			<?php 
    echo CHtml::ajaxSubmitButton("Pick", array("almacendocs/expedicion"), array("type" => "POST", "data" => array("codiguito" => "js:cbopuntoexped.value", "identidad" => "js:Almacendocs_id.value", "responsable" => "js:cboresponsable.value"), "update" => "#zonadespacho"), array('onClick' => 'Loading.show();Loading.hide(); return false;'));
    ?>
		</div>

		<?php 
    if (is_null($model->alkardex_almacendocs->codtrabajador) or empty($model->alkardex_almacendocs->codtrabajador)) {
        ?>
			<div class="row">
				<?php 
        echo CHtml::label('Responsable', 'Responsable');
        ?>
				<?php 
        $datos = CHtml::listData(VwTrabajadores::model()->findAll(array('order' => 'ap')), 'codigotra', 'nombrecompleto');
        echo CHtml::DropDownList('cboresponsable', 'responsable', $datos, array('empty' => '--Seleccione un responsable--'));
        ?>
			</div>
开发者ID:hipogea,项目名称:zega,代码行数:30,代码来源:_form_detalle.php

示例11: array

<span class='shopping-cart' id='<?php 
echo $this->id;
?>
'>
<?php 
$form = $this->beginWidget('CActiveForm', array('id' => 'buy-form-' . $this->id, 'enableAjaxValidation' => true, 'htmlOptions' => array('style' => 'display:inline;')));
?>
	<?php 
echo $form->hiddenField($this->form, 'id', array('value' => $this->model->getId()));
?>
	<?php 
echo $form->textField($this->form, 'quantity', array('size' => 2, 'class' => 'input'));
?>
	<?php 
echo CHtml::ajaxSubmitButton('купить', '', array('success' => 'js:function(data){ $("#shoppingCart").html($(data).find("#shoppingCart").html()); }'));
?>
	<?php 
echo $form->error($this->form, 'quantity');
$this->endWidget();
?>
</span>
开发者ID:BGCX261,项目名称:zoomtyre-svn-to-git,代码行数:21,代码来源:buy.php

示例12: array

?>
		<?php 
echo $form->textArea($model, 'comment');
?>
		<?php 
echo $form->error($model, 'comment');
?>
	</div>

	<div class="row shortrow buttons">
		<?php 
echo CHtml::ajaxSubmitButton(Yii::t('global', 'Send'), CHtml::normalizeUrl(array('wishlist/email', 'render' => false)), array('type' => "POST", 'dataType' => 'json', 'success' => 'js:function(data) {
					if (data.status=="success") {
						alert(data.message);
						$("#WishitemShare").dialog("close");
						$.ajax({url:data.url});
					} else { for(var key in data.errormsg) {
						var value = data.errormsg[key];
						$("#ShareForm_"+key+"_em_").html(value);
						$("#ShareForm_"+key+"_em_").show();
					}}
				 }'), array('id' => 'btnSendWishList'));
?>

	</div>

<?php 
$this->endWidget();
?>
</div><!-- form -->
开发者ID:uiDeveloper116,项目名称:webstore,代码行数:30,代码来源:_sharelist.php

示例13: array

	<div class="row">
		<?php 
echo $form->labelEx($model, 'reason');
?>
		<?php 
echo $form->textField($model, 'reason', array('size' => 60, 'maxlength' => 120));
?>
		<?php 
echo $form->error($model, 'reason');
?>
	</div>
<br />
	<div class="row buttons">
		<?php 
//echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save');
?>
         <?php 
echo CHtml::ajaxSubmitButton(Yii::t('attendance', 'Save'), CHtml::normalizeUrl(array('StudentAttentance/Addnew', 'render' => false)), array('success' => 'js: function(data) {
						$("#td' . $day . $emp_id . '").text("");
						$("#jobDialog123' . $day . $emp_id . '").html("<span class=\\"abs\\"></span>","");
						$("#jobDialog' . $day . $emp_id . '").dialog("close");
						window.location.reload();
                    }'), array('id' => 'closeJobDialog' . $day . $emp_id, 'name' => 'save'));
?>
	</div>

<?php 
$this->endWidget();
?>
</div>
</div><!-- form -->
开发者ID:akilraj1255,项目名称:rajeshwari,代码行数:31,代码来源:_form.php

示例14: array

                                    <?php 
echo $form->labelEx($modelc, 'keterangancuti');
?>
                                     <div class="mws-form-item ">                                            
                                    <?php 
echo $form->textArea($modelc, 'keterangancuti', array('rows' => 6, 'cols' => 30, 'onkeypress' => "return \$(this).focusNextInputField(event)"));
?>
                                      </div>
                            </div>
                                </td>
                            </tr>
                      </table>
                                    
                 <div class="mws-button-row">
                    <?php 
echo CHtml::ajaxSubmitButton($modelc->isNewRecord ? 'Create' : 'Create', '', array('replace' => '#formTab .mws-panel-body'), array('class' => 'mws-button blue', 'type' => 'submit', 'onKeyPress' => 'return formSubmit(this,event)'));
echo "  ";
echo CHtml::ResetButton($modelc->isNewRecord ? 'Reset' : 'Reset', array('class' => 'mws-button green'));
?>

                </div>   
                    
                <?php 
$this->endWidget();
?>

            </div>
        </div>    	
    </div><!-- form -->
<?php 
//    $url = Yii::app()->createAbsoluteUrl('kepegawaian/karyawan/cuti');
开发者ID:nelitaaas,项目名称:Tugas-Besar,代码行数:31,代码来源:_formCuti.php

示例15: array

	
	</fieldset>
	
	<div class="submit-button-wrapper">
		<?php 
echo CHtml::ajaxSubmitButton('Envoyer', null, array('dataType' => 'html', 'type' => 'post', 'beforeSend' => 'function(){
			$("#newsletter-subscription-form").addClass("form-processing");
		}', 'success' => 'function(data) {
			var jsonData = $.parseJSON($("#newsletter-subscription-form-json", $("<div>" + data + "</div>")).html());
				
			$("#newsletter-subscription-form [id$=\\"_em_\\"]").text("");                                                    
		    $("#newsletter-subscription-form [id$=\\"_em_\\"]").hide();
			$("#newsletter-subscription-form *:input[type!=\\"submit\\"]").removeClass("error");
				
			if (jsonData.status == "success") {
				$("#newsletter-subscription-form *:input[type!=\\"submit\\"]").val("");
				$("#newsletter-subscription-form-confirmation").modal("show");
			} else {
			    $.each(jsonData, function(key, val) {
					$("#newsletter-subscription-form #"+key+"_em_").text(val);                                                    
					$("#newsletter-subscription-form #"+key+"_em_").show();
					$("#newsletter-subscription-form #"+key).addClass("error");
			    });
	        }  
			$("#newsletter-subscription-form").removeClass("form-processing");     
	    }'), array('class' => 'btn btn-success btn-processing', 'title' => 'Envoyer', 'id' => 'newsletter-subscription-form-submit-button', 'name' => 'newsletter-subscription-form-submit-button'));
?>
    </div>
	
	<div id="newsletter-subscription-form-confirmation" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="Confirmation" aria-hidden="true">
		<div class="modal-dialog modal-sm">
开发者ID:kostya1017,项目名称:our,代码行数:30,代码来源:subscriptionFormWidget.php


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