gunnit
(Maric Gregor)
October 9, 2012, 10:39am
1
Hello all , thanks for reading , i am wandering how to disable the following message :
Please fix the following input errors: dummy,
I enabled ajax validation and now i keep on getting that message. can someone explain to me what it is reffering to and how to disable it on ajax validation?
softark
(Softark)
October 9, 2012, 11:16am
2
Hi gunnit,
What is "dummy"?
I mean, you have to elaborate your code a little more, otherwise we have no means to understand your issue.
zaccaria
(Matteo Falsitta)
October 9, 2012, 11:18am
3
This is generated by CHtml::errorSummary, remove it and you are done.
softark
(Softark)
October 9, 2012, 11:21am
4
Oh, is it? I didn’t know that.
gunnit
(Maric Gregor)
October 9, 2012, 12:40pm
5
I get "dummy" as a default value when i want to create a new reccord, but this only happens when i enable ajax validation. If i take off error summary i do not see the actual validation error messages . If iam not clear i can elaborate further
abennouna
(Abennouna)
October 9, 2012, 1:06pm
6
I think you have to post the relevant parts of your view and model as well.
It should come from CActiveForm’s errorSummary() code:
public function errorSummary($models,$header=null,$footer=null,$htmlOptions=array())
{
if(!$this->enableAjaxValidation && !$this->enableClientValidation)
return CHtml::errorSummary($models,$header,$footer,$htmlOptions);
if(!isset($htmlOptions['id']))
$htmlOptions['id']=$this->id.'_es_';
$html=CHtml::errorSummary($models,$header,$footer,$htmlOptions);
if($html==='')
{
if($header===null)
$header='<p>'.Yii::t('yii','Please fix the following input errors:').'</p>';
if(!isset($htmlOptions['class']))
$htmlOptions['class']=CHtml::$errorSummaryCss;
$htmlOptions['style']=isset($htmlOptions['style']) ? rtrim($htmlOptions['style'],';').';display:none' : 'display:none';
/* line 529 in v1.1.12 */
$html=CHtml::tag('div',$htmlOptions,$header."\n<ul><li>dummy</li></ul>".$footer);
}
$this->summaryID=$htmlOptions['id'];
return $html;
}
softark
(Softark)
October 9, 2012, 1:21pm
7
Thanks, bennouna. I didn’t know that.
But the display of that ‘dummy’ should be kept hidden by ‘display:none’ …