Show and validate terms during a registration

Show and validate terms during a registration

Requirement

Submit a form only if the terms and conditions are read and understood by the users.

Use Case 

Any application has a basic set of terms and conditions that a customer needs to accept before availing the services. There are two forms, Register for collecting the customer's details and Terms and conditions for displaying the terms and conditions. Before the customer submits the Register form, the Terms and conditions form opens and displays the terms and conditions for availing the services provided by the application.

See how it works

Steps to follow         

1. Create the forms with the following details:
Form
Form Link Name
Field Type
Field Name
Field Link Name
Terms Conditions
Terms_Conditions
Add Notes
Notes
plain
Decision Box
Understood
Decision_Box
Register
Register
Name
Name
Name
Email
Email
Email
Phone
Phone
Phone
Decision
I have read the terms and conditions.
Decision_Box

2. Mark the I have read the terms and conditions field in the Register form and the Understood field in the Terms Conditions form as Mandatory.

3. Duplicate the Terms Conditions form to create a stateless form. Rename it as Terms And Conditions. We are using a stateless form because it is not essential to store the decision box input of users separately.

4. Add a button Accept in the newly created stateless form.

5. Create a new workflow on the Register form, to execute on user input of the I have read the terms and conditions field.

6. Click the Add New Action and select Deluge Script. Add the below code in the ensuing editor.
  1. if(input.Decision_Box)
  2. {
  3.  openUrl("#Form:Terms_And_Conditions","popup window","height=450px,width=600px");
  4. }

This will open the Terms And Conditions form when the field is checked, with terms and conditions for the customer's perusal.

7. Create a new workflow on the Terms And Conditions form to execute when the Accept button is clicked.


8. Click Add New Action and select Deluge Script. Add the below code in the ensuing editor. This will close the Terms And Conditions popup window.
  1. if(input.Decision_Box)
  2. {
  3. openUrl("#Script:page.close","same window");
  4. }

See how it works