Hi,
I would validate each step's data and save it in session.
However, if any previous tab is clicked and there was an attempt to
change any validated input,
then I would validate that input again.

In other words,
click 2nd tab->validate 1st tab data and save in session.
click 3rd tab->validate 2nd tab data and save in session
click submit button -> validate 3rd tab data and insert the
session-saved+3rd tab's validated data in db (or any operation else)
if any previous/validated tab clicked and information is changed on
that tab (before the submit is clicked), re-validate that data again.
I do not think there is a need to re-submit all tabs' data again once
the submit button is clicked.

scs



On Fri, Mar 12, 2010 at 8:04 PM, David Mintz <[email protected]> wrote:
> Embarking on my first ajaxified Zend Form with a JQuery UI-tabbed interface,
> I am wondering what sort of practices people recommend.
>
> Say we have tabs 1, 2 and 3, left to right. Tab 1 is displayed first. They
> click tab 2. We use a JQuery tabsselect callback to submit only the data
> from tab 1 for validation. So... in the controller I presume we should call
> $form->processAjax(...) to validate the $_POSTed data, yes?
>
> Back to the client side, the JQuery callback displays errors and returns
> false if there are any errors, otherwise true and the next tab is displayed.
> Right?
>
> When they finally click the submit button, do we xhr-submit all the data
> from all the tabs and fields, and validate it all once again? It seems
> redundant if you do, but risky if you don't.
>
> OTOH, with each click on the next tab, you could actually save the
> successfully validated data from the current tab (in this case, in a
> database) and carry on. That would obviate the need for re-validating. Then
> again, as a user I don't expect to save until I actually click a submit
> button rather than a tab.
>
> Comments?
>
> --
> Support real health care reform:
> http://phimg.org/
>
> --
> David Mintz
> http://davidmintz.org/
>
>
>

Reply via email to