For each step i’ve created a controller/Action, in each view of this 3 steps i’ve back and next button.
So when i click next simply submit the form to the next action and trigger the client side validation.
Here the problem: when i click on back button, i want to skip client side validation.
I’ve tried this method but it didn’t work:
Create a hidden field called ‘submitType’ initially filled with the value ‘send’
Declaring back button as simple button (not submit button), when i clic on back, he trigger his own onclick function, that at first set submitType value as ‘back’ and the call submit, in this way
If i substitute form.submit() whit “return true” the client side validation start and i don’t want this. I’ve tried also with “return false” and in this case nothing happens.
Yes, you can, but first you should decide is it really needed (back link is more like a get request, no?)
If post is needed, you can use js onclick handler to create and submit a form.
If you need to post back the same form from step 2 - it’s simpler to use button instead of link. Just modify your form submit/validate handlers slightly to intercept required events and not to fall into recursion.
Yeah is exactly what i’m trying to do, but i don’t know how, can you post some pieces of code?
In the first post of this topic i’ve pasted the code that i’ve used.
I know how to intercept the request, when it’s used pure jQuery, but here, is the yiiactiveform.js that intercept all the request, and i don’t know how to modify to my purpose.