i want to disable chtml link with one condition…
how to disable link???
i try this with but not work
CHtml::link('Add Icon',array('/image/createIcon','idContent'=>$model->id_content, array('disable'=>true)));
thanks in advance…
i want to disable chtml link with one condition…
how to disable link???
i try this with but not work
CHtml::link('Add Icon',array('/image/createIcon','idContent'=>$model->id_content, array('disable'=>true)));
thanks in advance…
hi
you can’t disable direct this way but use css class like below
echo CHtml::link(‘Add Icon’,array(’/image/createIcon’,‘idContent’=>$model->id_content), array(‘class’=>‘css_class_name’));
can u show me the code of css?
sorry if i ask stupid question but i’m new in programing web n yii…
You have to disable the ‘onclick’ too:
CHtml::link('Add Icon',array('/image/createIcon','idContent'=>$model->id_content, array('onclick'=>'return false;','style'=>'color:gray;')));
didn’t work to me…
It has a typo. Correction:
CHtml::link('Add Icon',array('/image/createIcon','idContent'=>$model->id_content), array('onclick'=>'return false;','style'=>'color:gray;'));
If I do this:
array('onclick'=>'return false;','style'=>'color:gray;'));
the button disables without first submitting the form.
How do you disable the button after first submitting the form?
I got it working with jquery. Is there a better way?
<?php
echo CHtml::link($caption,'#', array(
'id'=>'btnSubmitMisc',
'submit'=>array($actionUrl),
'class'=>'myCHtmlButton',
));
?>
<?php
Yii::app()->clientScript->registerScript('submitTest', "
$('#btnSubmitMisc').click(function(){
if($('#btnSubmitMisc').hasClass('myCHtmlButton'))
{
$('#btnSubmitMisc').removeClass('myCHtmlButton');
$('#btnSubmitMisc').addClass('myCHtmlButtonClicked');
}
else
{
return false; // Don't submit if class is myCHtmlButtonClicked
}
});
");
?>