Hi,
I have a Formbuilder form which has 2 pages. An option selected on the first page determines which fields are displayed on the 2nd page. I have this working fine using jQuery.
However, I want to do some form validation on the 2nd page which can't be done using the Formbuilder validation, so I need to call a UDT on form submission. However, the UDT gets called on submission of each page (ie. when clicking Next from page 1 to page 2 of form). How do I check in the UDT if the form page being submitted is page 2 or page 1?
I basically need to be able to test the $this_page value from the form, but I can't access this variable from the UDT.
Thanks!
FormBuilder validation with UDT on multi-page form
Re: FormBuilder validation with UDT on multi-page form
You could have a look at what data is available in the submission.
Just print it out in the UDT (good tip I learned on GeekMoot: print stuff you want in UDT and end with
In this case, you need to add this statement just before hitting the final submit button.
If I look at the submission of my sample form and use a web inspector to see what data is submitted I find:
I'd guess the 'done' value of 1 would be worth a try...
Just print it out in the UDT (good tip I learned on GeekMoot: print stuff you want in UDT and end with
Code: Select all
die();
If I look at the submission of my sample form and use a web inspector to see what data is submitted I find:
Code: Select all
mact
FormBuilder,cntnt01,default,0
cntnt01returnid: 23
cntnt01fbrp_callcount: 4
cntnt01form_id: 2
cntnt01fbrp_continue: 3
cntnt01fbrp_previous: 1
cntnt01fbrp_done: 1
...
Re: FormBuilder validation with UDT on multi-page form
Thanks velden.
I worked out that I can add a hidden form field in the Form Template and assign the value of $this_page to that field. Then, when page 1 of the form gets posted, I can read the value of that form field from the UDT using $_FORM[field_name]
Appreciate the tip!
I worked out that I can add a hidden form field in the Form Template and assign the value of $this_page to that field. Then, when page 1 of the form gets posted, I can read the value of that form field from the UDT using $_FORM[field_name]
Appreciate the tip!