Yii Framework Forum: [EXTENSION] EAjaxValidationMessages - Yii Framework Forum

Jump to content

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

[EXTENSION] EAjaxValidationMessages Display validation error messages coming fom an AJAX-called action. Rate Topic: -----

#1 User is offline   MetaYii 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 393
  • Joined: 07-October 08
  • Location:The Matrix

Posted 15 September 2011 - 08:54 AM

EAjaxValidationMessages was created in order to make more general the solution of the problem described here:

http://www.yiiframew...on/#entry113276

The extension can be downloaded here:

http://www.yiiframew...dationmessages/
Ah! on-off, simplement!
0

#2 User is offline   Mukesh 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 107
  • Joined: 17-May 11
  • Location:India

Posted 15 September 2011 - 10:26 AM

great extension! i had a feature request.

Would be great if you could make it more customizable. Like, ability to just show error summary or apply css from some other file.
0

#3 User is offline   MetaYii 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 393
  • Joined: 07-October 08
  • Location:The Matrix

Posted 15 September 2011 - 01:06 PM

View PostMukesh, on 15 September 2011 - 10:26 AM, said:

Like, [ability to] apply css from some other file.


Hi Mukesh, yes, I plan to introduce more features as my project requires them, very soon, the first one would be great (show summary). But I didn't understand this one (apply css from some other file). Could you explain this in more detail?

Thanks.

P.S. Anyway I must insist: yiiactiveform should provide these things directly. Maybe the maintainers could take this extension into account to add the functionality (certainly improved and more consistent, as they can modify the core).
Ah! on-off, simplement!
0

#4 User is offline   Mukesh 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 107
  • Joined: 17-May 11
  • Location:India

Posted 16 September 2011 - 02:33 AM

please forget my css remarks.
I have one other question - How is the widget supposed to behave if the same form repeats itself multiple times in the same page. The element id construction (jQuery('#'+key+'_em_') seems to assume the presence of a single form in a page. Is there anyway to change the code (i am a jquery newbie) so that it takes into consideration the id of the form it was called for and show errors with that form only (id some-form in this case - jQuery('#some-form').ajaxvalidationmessages('show', html);).
0

#5 User is offline   dckurushin 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 392
  • Joined: 16-March 11
  • Location:Israel

Posted 16 September 2011 - 02:46 AM

Sounds very useful... defiantly will check it out soon...
0

#6 User is offline   MetaYii 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 393
  • Joined: 07-October 08
  • Location:The Matrix

Posted 16 September 2011 - 11:30 AM

Version 1.1 (20110916) - Summary is shown if it exits. You need to specify the CSS class name for the summary, since it's used as the selector to display it.
Ah! on-off, simplement!
0

#7 User is offline   MetaYii 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 393
  • Joined: 07-October 08
  • Location:The Matrix

Posted 16 September 2011 - 11:58 AM

View PostMukesh, on 16 September 2011 - 02:33 AM, said:

please forget my css remarks.
I have one other question - How is the widget supposed to behave if the same form repeats itself multiple times in the same page. The element id construction (jQuery('#'+key+'_em_') seems to assume the presence of a single form in a page. Is there anyway to change the code (i am a jquery newbie) so that it takes into consideration the id of the form it was called for and show errors with that form only (id some-form in this case - jQuery('#some-form').ajaxvalidationmessages('show', html);).



I haven't used the same model more than once in the same page, so I don't know how Yii solves the problem of having duplicated IDs for the elements. Do you have a sample of your HTML which you could post?
Ah! on-off, simplement!
0

#8 User is offline   Mukesh 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 107
  • Joined: 17-May 11
  • Location:India

Posted 16 September 2011 - 10:19 PM

View PostMetaYii, on 16 September 2011 - 11:58 AM, said:

I haven't used the same model more than once in the same page, so I don't know how Yii solves the problem of having duplicated IDs for the elements. Do you have a sample of your HTML which you could post?

Yii generates duplicate ids for the form elements. So, i generate the ids myself. I think i will have to customize your code to suit my needs.
0

#9 User is offline   sonam 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 79
  • Joined: 10-September 11

Posted 19 September 2011 - 06:44 AM

Please explain me what are extensions?How do we use it?where to use it?why to use it?diff between behaviours.components,widgets and are they the childern of extensions or subparts............Please explain as i am new to yii and also i am not really able to understand the conventions of variables in yii.Because in cakephp there are certain rules which are not present in this framework???????????//Please help me out as I am very keen to understand the basic things rather than going directly to the higher step
0

#10 User is offline   blacksheep 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 180
  • Joined: 31-December 11

Posted 07 February 2012 - 10:45 AM

Thanks you so much!!!

i have a little problem. all works, but if i have an error (for example field required) and the fill the field, the error doesn't hide

i use the id of my form

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


than in success

jQuery('#users').ajaxvalidationmessages('hide');


i have try also with the id of my div id
if i write an alert inside else, i see alert.

thanks
So di non Sapere
0

#11 User is offline   blacksheep 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 180
  • Joined: 31-December 11

Posted 10 February 2012 - 04:11 AM

if i use
"dataType" => "json",

not works?
So di non Sapere
0

#12 User is offline   florin p 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 36
  • Joined: 25-September 11

Posted 19 August 2012 - 09:49 AM

View Postblacksheep, on 07 February 2012 - 10:45 AM, said:

Thanks you so much!!!

i have a little problem. all works, but if i have an error (for example field required) and the fill the field, the error doesn't hide

i use the id of my form

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


than in success

jQuery('#users').ajaxvalidationmessages('hide');


i have try also with the id of my div id
if i write an alert inside else, i see alert.

thanks



Hi,

I have the same problem, did you fix it?
0

#13 User is offline   msoa 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 260
  • Joined: 15-August 12

Posted 13 April 2013 - 07:57 AM

View Postflorin p, on 19 August 2012 - 09:49 AM, said:

Hi,

I have the same problem, did you fix it?


I also have same problem but with a little difference: I have several fields, when filling the last field altered the error remain on it and don't hide. Can you resolve it?

And other thing, how to show errorSummary? Can take an example?
0

#14 User is offline   msoa 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 260
  • Joined: 15-August 12

Posted 21 April 2013 - 09:15 AM

View Postblacksheep, on 07 February 2012 - 10:45 AM, said:

Thanks you so much!!!

i have a little problem. all works, but if i have an error (for example field required) and the fill the field, the error doesn't hide

i use the id of my form

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


than in success

jQuery('#users').ajaxvalidationmessages('hide');


i have try also with the id of my div id
if i write an alert inside else, i see alert.

thanks


If using from extension not very important for you, here is my practice that have no these problems. with little manipulation you can write a beautiful extension.
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