Yii Framework Forum

How to disable clientvalidation on specific button ( Cancel Button )

(Sven Siwek) #1


I need a Cancel Button which does call my controller.

I want to have client validation in my form, but I also want a “Cancel Button”.

I havent found any option/parameter for html::a or html::submitButton to switch off validation on just that button.

I am aware of "‘enableClientValidation’=>false, " which does disable clientvalidation for whole form, which I wont want.

Any help appreciated

(Jaimez) #2

Why do you need to disable client validation in this situation ? As far as I know client validation is fired only when input element lost focus. When you click on the button, unless it is submit button, no validation should be ran.