How to disable clientvalidation on specific button ( Cancel Button )

Hi,

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
Sven

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.

Hi!, I am having the same issue. Were you able to solve this?

I do something like the following
In my view

<?= Html::a('Cancel',['erfassen/cancel','id'=>$model->id], [ 'class' => 'btn btn-warning ', 'accesskey' => 'c', ]) ?>

In the Controller

public function actionCancel($id)
{

  /**
  *    special id handling ...
  **/

    return $this->redirect("index");
    
}