clonevn
(Clonevn)
May 16, 2013, 4:44pm
1
in the view, we usually have:
<?php echo CHtml::link('Advanced Search','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('/_search'); ?>
My question is the ‘#’ will trigger the class=“search-form” to be displayed. I would like to change it to able to display or hide other class like class =“new-form”. Can anyone show me the way? Thank in advance.
clonevn:
in the view, we usually have:
<?php echo CHtml::link('Advanced Search','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('/_search'); ?>
My question is the ‘#’ will trigger the class=“search-form” to be displayed. I would like to change it to able to display or hide other class like class =“new-form”. Can anyone show me the way? Thank in advance.
Please your question is not clear!, what do u want, to show/hide two forms (classes) on its click? or just one.
You can use this script
Yii::app()->clientScript->registerScript(‘search’, "
$(’.search-button’).click(function(){
$('.search-form').toggle();
return false;
});
");
so here when button clicks it toggle the form, so can more over here…
clonevn
(Clonevn)
May 17, 2013, 1:24pm
3
I will explain that I made a copy of "Advanced Search" link and put my view inside:
<?php echo CHtml::link('My Search','#',array('class'=>'mysearch')); ?>
<div class="myform" style="display:none">
<?php $this->renderPartial('//url here'); ?>
But it not works .
Thank you a lot for helping me, I will try it and get back to you later.