MetaYii
(Metayii Framework)
September 2, 2011, 5:15am
1
I have a CActiveForm with some fields which are validated client side. I need to trigger client-side (javascript) validation from a custom javascript function when I click a link. Is there any way to do this? Something like:
<a href="someurl.html" onclick="executeValidators(params)">Validate me!!!!!</a>
where [font="Courier New"]executeValidators[/font] is my function which should trigger client-side validation, something like this:
function executeValidators(someParams)
{
// client-side validators are executed here...
}
Any help is appreciated.
Sisko
(Cjaegle)
December 7, 2011, 12:28pm
2
Same problem here. Any hints?
Did you ever find a solution for this?
MetaYii:
I have a CActiveForm with some fields which are validated client side. I need to trigger client-side (javascript) validation from a custom javascript function when I click a link. Is there any way to do this? Something like:
<a href="someurl.html" onclick="executeValidators(params)">Validate me!!!!!</a>
where [font="Courier New"]executeValidators[/font] is my function which should trigger client-side validation, something like this:
function executeValidators(someParams)
{
// client-side validators are executed here...
}
Any help is appreciated.
Hi please see forum
like
<span onclick="javascript:checkErrors();" class="gray_button">
<?php echo CHtml::submitButton('Save'); ?>
</span>
I hope it’s some help.
shgninc
(Shgninc)
October 7, 2013, 7:39am
5
The CActiveForm have a property named $enableClientValidation which determine to enable client-side data validation. Defaults to false.
http://www.yiiframework.com/doc/api/1.1/CActiveForm#enableClientValidation-detail