If you have mandatory fields on e.g. page 5 and go back to Page 4 -- webforms checks for mandatory fields on 5.
This is pretty strange as we should always be able to step back with no limitations.

It should be pretty straightforward to omit the validation on 'Prev'.

Agree to do so?

CommentFileSizeAuthor
#1 588354.patch650 bytesmiro_dietiker

Comments

miro_dietiker’s picture

Status: Active » Needs review
StatusFileSize
new650 bytes

As i see fapi introduces these issues since #required is checked by fapi.

Please add support for the solution at:
http://drupal.org/project/skip_validation

This won't be a dependency but much more a perfect integration if the module is present.

The only thing you need to do is add a single line to trigger the skip_validation process for the previous button.
See patch provided below.

Thanks

miro_dietiker’s picture

Version: 6.x-2.7 »

Sorry this patch was against a current cvs checkout... that was 6.x-3.x-dev ... right?
This should be fully working on all previous releases without any modifications.

quicksketch’s picture

There's also an interesting work-around in #266287-6: mandatory components interfere with previous page button which might be worth considering.

miro_dietiker’s picture

Thanks quicksketch. I've tried something like comment 3 suggested without success. I might have done it wrong.
Finally i've found the solution provided.
Indeed fapi should provide something like that and skip_validation is a great transparent and minimalistic (but pretty expensive) workaround for all form clients...

Now if #266287 works it seems to be much more simple without requiring any further contrib. So for the moment (if it works) i'd prefer the form_set_error approach.
Whereas i'd expect to move it towards something like i suggested as soon as fapi supports it (D7 ...).

Please consider yourself which is the better solution. I'm happy to review as soon as provided.

quicksketch’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.