February 9, 2012, 4:17pm
[size="3"]There is a form generated by
CActiveForm with enableClientValidation set to true.
It is all OK, but after that when i correct wrong value i still see error message until i remove focus from that field.
If i try to submit form when cursor is still in that filed nothing happens but just error massage disappears instead of form sending. So i have to submit once again to send.
Is there any way to avoid this behaviour?[/size]
I haven’t played with client validation too much but it sounds like an event (maybe onBlur) is firing - preventing you from submitting the form. Check to see what events are being triggered. Post your code if your still stuck.
February 9, 2012, 6:45pm
Thanks for reply.
It is not some special code that i am working on. It is just standard behaviour out of the box. To see this effect one can just create empty project and go to "contact us" page.
I’ve tested it on a blank app and all’s OK - the form submits once all fields are valid. Post your code and I’ll take a look.
February 10, 2012, 9:57am
I installed a virgin new application to domain
[color=" to show the issue. #4169E1"] tattoo-otzyv.ru[/color]
Go to page [color="
#4169E1"] [/color] tattoo-otzyv.ru/index.php?r=site/contact
Fill all fields correctly exept of captcha
Fill incorrect value to captcha field.
Submit form (captcha field becomes red, captcha error message appears)
Change captcha field value to correct.
Do not remove cursor from captcha field.
Submit form with mouse click.
After that i just see captcha field becomes green, error message disappears
but no form submission and i have to click submit one more time.
If instead of click submit button i just push enter all goes OK
(Maurizio Domba Cerin)
February 10, 2012, 10:46am
I think this is already fixed in the trunk… try with the latest Yii code (checkout from googlecode)…
I think mdomba’s correct. I pulled the latest SVN version this morning so I’m not seeing the same issue.
February 10, 2012, 11:33am
Thanks a lot
Code from [color="
#4169E1"] [/color] just works great yii.googlecode.com/svn/trunk/
More than that, if
validateOnType option is enabled the whole form revalidates on every keyUp event, that is realy cool.