Doesnt Show The Error Messages On Validation When There Is A Datepicker


(Nurbek Nurjanov) #1

There are strange bug, which answer I cant find searching in google a lot.

There is a simple active form, with ajax validation, everything works ok.

But when I use the EDatePicker extension, the error messages of all fields, when I type wrong format, they all are not showing. They all are hiding with display:none by some javascript as it seems to me.

If I delete the datepicker, the form works normally good. What the shit with this datepicker, am I alone with this problem, I didnt find the same probelm at the internet, but I noticed this bug for along time, but still I didnt fint the answer. Appricate you, if you help.


(Boraganesh) #2

can you please share link of application or paste the screen shot of firebug so i can debug. may be datepicker css for error getting override.


(Traprajith) #3

its ajax and javascript mismatch. use firebug console to find whats happening


(Nurbek Nurjanov) #4

4182

Без имени-1.jpg


(Nurbek Nurjanov) #5

I am using the jui datepicker last version, I delete the assets files, but anyway the strange problem is exists, I am sure, I can see it youselfs, just use the jui datepicker and enable ajaxvalidation in your activeform, and you you will see it youself


(Softark) #6

Hi Nurbek,

I have used many CJuiDatepickers in many CActiveForms with ajax validation enabled, and have got no problem so far.

This is just a guess, but I think that your form might have a mismatching tag: an opening tag without the corresponding closing tag, or a closing tag without the opening tag, or, incorrectly nested tags.

Anyway, could you please share your view code?


(Nurbek Nurjanov) #7

About your guess, I deleted all html elements, exactly i didnt use the layout main template, just clear column layout, like this

4185

Без имени-1.jpg

I use the datepicker this way


          

  $this->widget('system.extensions.jui2.EDatePicker',

                                  array(

                                        'model'=>$model,

                                        'attribute'=>'date',

                                        'fontSize'=>'9px',

                                        'language'=>'ru',

                                        'mode'=>'button',

                                        'theme'=>'base',

                                       )

                                 );



are sure that in your it’s ok? cause I check it all my project, and everywhere there is some wrong with ajax validation.


(Softark) #8

Can you post the whole code of your form, not just that of the datepicker alone?


(Nurbek Nurjanov) #9



<?

$form=$this->beginWidget('CActiveForm', array(

    'id'=>'compred-form',

    'enableAjaxValidation'=>true,

    //'clientOptions'=>array('validateOnChange'=>true),

    //'htmlOptions'=> array(),

));

?>

<?=$form->errorSummary($model); ?>


<div class="row">

        <?=$form->labelEx($model,'date'); ?>

        <?

        $this->widget('system.extensions.jui2.EDatePicker',

                      array(

                            'model'=>$model,

                            'attribute'=>'date',

                            'fontSize'=>'9px',

                            'language'=>'ru',

                            'mode'=>'button',

                            'theme'=>'base',

                           )

                     );

        ?>

</div>

<div class="row">

    <?=$form->labelEx($model,'priority'); ?>

    <?=$form->textField($model,'priority'); ?>

    <?=$form->error($model,'priority'); ?>

</div>


<? $this->endWidget(); ?>





(Softark) #10

Thanks.

Hmm, I see nothing wrong with your code. I don’t know whart’s wrong …

One thing I’m interested is in your last screen short. It reads like this:




<form>

    <div id="compred-form_es_" ...> ... error summary

    <div class="row"> ... datepicker

    <div class="row error"> ... priority

        <label class="required" for="Compred_priority"> ... label for "priority"

        <input> ... textfield for "priority"

        <div> ... error message for "priority"

    </div>



It looks like the whole div for "priority" is in the error message div for the datepicker, just as if the closing div tag for the datepicker is missing …

[EDIT]

Ah, sorry. I was wrong. There’s nothing wrong except the “display:none” in the error message for “priority”. Hmm, I’m stuck, too.


(Softark) #11

BTW, what’s “EDatePicker”?

Is it from this package? … http://www.yiiframework.com/extension/jui/

Why don’t you try the default CJuiDatepicker just for a test?




$this->widget('zii.widgets.jui.CJuiDatePicker',array(

    'model'=>$model,

    'attribute'=>'date',

));




(Nurbek Nurjanov) #12

softark

thank you very much, you helped me very much, CJuiDatepicker works fine, and dosnt broke others.

yes, I will begin to use CJuiDatepicker instead of Edatepicker, which I have downloaded from there http://www.yiiframework.com/extension/jui/

dont use the datepicker from here.

Because there is a shit bug, I found it there, in jquery-ui-1.7.1.custom.min.js file in the 154 line.

there is overwrite function of toggle,

the body of this function is like this:


toggle:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))||(arguments[0].constructor==Function)){return this.__toggle.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"toggle"))}}

that is the shit.