• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Conditional Multi Page Validation Issue

Conditional Multi Page Validation Issue 8 years 8 months ago #35576

Hello,

I am creating conditional multi page form with reference to this www.rsjoomla.com/support/documentation/r...multi-page-form.html

I have 6 page form.

On page 1, there is option "How many people" (field name = multibooking) options are (1|2),
Page 2 is for user information for person 1.
Page 3 is for user information for person 2.
(Kind of room booking system)

So when user select "How many people" = 1, it should skip page 3 by default, but when user select "How many people" = 2, it should also display the page 3 as normal.

But the issue is, we have some required fields on both page 2 and page 3.

But some how page is not validating when we move from page 2 to 3, when we have selected "How many people" = 1, and its allowing user to skip required information on page 2, but it works fine, when we have selected "How many people" = 2.

Does any one have any item, how to validate form based on condition.

Here is my code, (PLEASE NOTE, FOR NOW TEMPORORY SOLUTION, I AM VALIDATING FIELD USING CUSTOM FUNCTION CREATED MY SELF USING JAVA SCRIPT VALIDATION, BUT WANT FORM TO WORK AS NORMAL WITH AJAX VALIDATION, LIKE ALL OTHER PAGES)

if(page == 3 && document.getElementById('multibooking').value == "2"){
if(!page3validation()){
return;
}
}

if(page == 2 && document.getElementById('multibooking').value == "1" && typeof validate != 'undefined'){
if(!page2validation()){
return;
}
else{
rsfp_changePage(formId, page+1, totalPages, validate);
return '';
}
}

//the following if clause will address the change page functionality when the "Previous" button is used
//While moving from page 4 to page 3 or 2, based on multibooking value.
if(page == 2 && document.getElementById('multibooking').value == "1" && typeof validate == 'undefined'){
rsfp_changePage(formId, page-1, totalPages, validate);
return '';
}

Please correct me if I have made any mistake. Do let me know if you needs any more information to understand it.

Thank you,
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!