[EXTENSION] EAjaxValidationMessages Display validation error messages coming fom an AJAX-called action.
#1
Posted 15 September 2011 - 08:54 AM
http://www.yiiframew...on/#entry113276
The extension can be downloaded here:
http://www.yiiframew...dationmessages/
#2
Posted 15 September 2011 - 10:26 AM
Would be great if you could make it more customizable. Like, ability to just show error summary or apply css from some other file.
#3
Posted 15 September 2011 - 01:06 PM
Mukesh, on 15 September 2011 - 10:26 AM, said:
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).
#4
Posted 16 September 2011 - 02:33 AM
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)
#5
Posted 16 September 2011 - 02:46 AM

Test Yii:
Yii Framework Demos
Wiki:
Common Yii Questions
Tutorials:
Demo Blog Search with Zend_Lucene
Fundamentals:
Yii "registry" | Understanding the layout->view randering flow
Etc:
Shrink Yii | Caching config/main.php | CPhpAuthManager - how it works, and when to use it
Extensions:
Theme Picker | Language Picker (i18n)
#6
Posted 16 September 2011 - 11:30 AM
#7
Posted 16 September 2011 - 11:58 AM
Mukesh, on 16 September 2011 - 02:33 AM, said:
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?
#8
Posted 16 September 2011 - 10:19 PM
MetaYii, on 16 September 2011 - 11:58 AM, said:
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.
#9
Posted 19 September 2011 - 06:44 AM
#10
Posted 07 February 2012 - 10:45 AM
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
#12
Posted 19 August 2012 - 09:49 AM
blacksheep, on 07 February 2012 - 10:45 AM, said:
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?
#13
Posted 13 April 2013 - 07:57 AM
florin p, on 19 August 2012 - 09:49 AM, said:
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?
#14
Posted 21 April 2013 - 09:15 AM
blacksheep, on 07 February 2012 - 10:45 AM, said:
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.

Help















