Can Yii Validation Scenarios Work With Clientside Validation ?

Hello all,

I’m getting no luck.

Let’s imagine we have a form where the user can check to either publish or just insert those data into db. In order to save into db only a few fields are required, in order to publish it however, more fields should be filled in.

So, I’m using scenarios.

The problem is:

I can’t get:


to work with those scenarios.

The user checks the box, and it MUST hit submit in order for Yii to realize the scenario option.

Can anyone please help me out with the code to make such a checkbox to work ?

When we check that box, should it call the server asynchronously and set the proper scenario ?

Can anyone help me with the js ajax sintax please ?