Yii Framework Forum: Doesnt Show The Error Messages On Validation When There Is A Datepicker - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Doesnt Show The Error Messages On Validation When There Is A Datepicker Rate Topic: -----

#1 User is offline   Nurbek 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 22
  • Joined: 26-August 09

Posted 29 April 2013 - 03:58 AM

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.
0

#2 User is offline   yii new expert 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 50
  • Joined: 30-May 12
  • Location:pune, india

Posted 29 April 2013 - 04:12 AM

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.
0

#3 User is offline   Rajith R 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 831
  • Joined: 20-April 11
  • Location:India

Posted 29 April 2013 - 05:03 AM

its ajax and javascript mismatch. use firebug console to find whats happening
Rajith Ramachandran,
Wiwo inc.
| Mobile: 919995504508
0

#4 User is offline   Nurbek 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 22
  • Joined: 26-August 09

Posted 30 April 2013 - 06:05 PM

View PostGanesh Bora, on 29 April 2013 - 04:12 AM, said:

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.

Attached File  Без имени-1.jpg (272.34K)
Number of downloads: 9
0

#5 User is offline   Nurbek 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 22
  • Joined: 26-August 09

Posted 30 April 2013 - 06:08 PM

View PostRajith R, on 29 April 2013 - 05:03 AM, said:

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

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
0

#6 User is offline   softark 

  • Keep It Simple
  • Yii
  • Group: Moderators
  • Posts: 2,005
  • Joined: 16-February 11
  • Location:Japan

Posted 01 May 2013 - 04:42 AM

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?
0

#7 User is offline   Nurbek 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 22
  • Joined: 26-August 09

Posted 02 May 2013 - 08:28 AM

View Postsoftark, on 01 May 2013 - 04:42 AM, said:

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?

About your guess, I deleted all html elements, exactly i didnt use the layout main template, just clear column layout, like this
Attached File  Без имени-1.jpg (281.15K)
Number of downloads: 3

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.
0

#8 User is offline   softark 

  • Keep It Simple
  • Yii
  • Group: Moderators
  • Posts: 2,005
  • Joined: 16-February 11
  • Location:Japan

Posted 02 May 2013 - 08:31 AM

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

#9 User is offline   Nurbek 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 22
  • Joined: 26-August 09

Posted 02 May 2013 - 08:45 AM

View Postsoftark, on 02 May 2013 - 08:31 AM, said:

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

<?
$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(); ?>


0

#10 User is offline   softark 

  • Keep It Simple
  • Yii
  • Group: Moderators
  • Posts: 2,005
  • Joined: 16-February 11
  • Location:Japan

Posted 02 May 2013 - 09:16 AM

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.
0

#11 User is offline   softark 

  • Keep It Simple
  • Yii
  • Group: Moderators
  • Posts: 2,005
  • Joined: 16-February 11
  • Location:Japan

Posted 02 May 2013 - 09:51 AM

BTW, what's "EDatePicker"?
Is it from this package? ... http://www.yiiframew.../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',
));

0

#12 User is offline   Nurbek 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 22
  • Joined: 26-August 09

Posted 02 May 2013 - 01:01 PM

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.yiiframew.../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.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users