Validation Rules do not get applied (sometimes)

Hi, Here is a problem with an easy workaround, but just wondering if the problem has been surfaced.
I have a record in my DB with so many columns that I have spread the entry of data over 2 pages. The second page is actually the first page reloaded but pointed to the second set of columns.
The first page takes data for the first set of columns, saves, puts the ID into a session variable, reloads the page again with the second set of columns and when data entry is done, a final save executed. Before I get comment that why do I not make the second page a separate physical page, where the below problem might not occur, this strategy is part of a much bigger strategy that needs this approach.

On both pages there are email, date and numeric text inputs. On each email, numeric and date input I have defined the appropriate validation rule.

But they only work on the first page, not the second. The second pages will not validate.

My quick workaround is to define the appropriate text inputs as email, date and number, which avoids the need to validate, but just wondering why the validations would not work on the 2nd page.

It sounds like conditional regions could be your friend here.

Put form 1 in a conditional region the shows when form 1 has no data. When submitted, it removes its content and then shows the content of a second conditional region when the form data is returned.

Form 2 could be the same form as 1, filled with values returned from 1 as hidden fields, and the extra fields you need at this step.

You could have a back button in conditional 2 that resets the data for form 1 and therefore shows it again.

No horrible UX of page reload but the same effect and each form can be given relevant validation rules.

Cheers for that, thats the thing with Wappler, there is always another approach, thanks for the hint.

1 Like