<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm',array( 'id'=>'search-slider-form', 'action'=>Yii::app()->createUrl($this->route), 'method'=>'get', )); ?> <?php echo $form->textFieldRow($model,'id',array('class'=>'span5')); ?> <?php echo $form->textFieldRow($model,'foto',array('class'=>'span5','maxlength'=>255)); ?> <?php echo $form->textFieldRow($model,'titulo',array('class'=>'span5','maxlength'=>150)); ?> <?php echo $form->textFieldRow($model,'descripcion',array('class'=>'span5','maxlength'=>200)); ?> <?php echo $form->textFieldRow($model,'txt_btn',array('class'=>'span5','maxlength'=>50)); ?> <?php echo $form->textFieldRow($model,'link',array('class'=>'span5','maxlength'=>300)); ?> <div class="form-actions"> <?php $this->widget('bootstrap.widgets.TbButton', array('buttonType'=>'submit', 'type'=>'primary', 'icon'=>'search white', 'label'=>'Search')); ?> <?php $this->widget('bootstrap.widgets.TbButton', array('buttonType'=>'button', 'icon'=>'icon-remove-sign white', 'label'=>'Reset', 'htmlOptions'=>array('class'=>'btnreset btn-small'))); ?> </div> <?php $this->endWidget(); ?> <?php $cs = Yii::app()->getClientScript(); $cs->registerCoreScript('jquery'); $cs->registerCoreScript('jquery.ui'); $cs->registerCssFile(Yii::app()->request->baseUrl.'/css/bootstrap/jquery-ui.css'); ?> <script> $(".btnreset").click(function(){ $(":input","#search-slider-form").each(function() { var type = this.type; var tag = this.tagName.toLowerCase(); // normalize case if (type == "text" || type == "password" || tag == "textarea") this.value = ""; else if (type == "checkbox" || type == "radio") this.checked = false; else if (tag == "select") this.selectedIndex = ""; }); }); </script>