On parameters include a wildcard * you are expected to replace the wildcard with the form id. This enables you to call your own function after a specific form event.
The parameters are explained below, followed by a motivating example.
This is the id of the project which you would like to load.
This is a one time authentication method for a user. In order to create the token, use login in the users endpoint on the server side.
The id of the form which you'd like to load on the initial system population. Note that if you're selecting a form that requires the user to be logged in, you must supply token. All anonymous forms do not require token.
The id of the HTML element you want the Regpack system to populate in. Note that the system will generate an iframe inside of that HTML element.
The default id the system looks for is regpack_iframe_container.
This allows you to create your own function that is called when a specific form submits. A form is designated by it's id, such as form_submit_2514736. The system will send the form response object as the first parameter of the function.
Same as form_submit_*, except that it is called when a form loads and no parameters are passed over. This is generally used when you want to redirect the user.
The top bar shows additional details to the applicant, including a section to edit credentials, to navigate to the dashboard, and a progress bar that allows them to navigate through forms. The default for this is false (i.e. to show it), but the default can be switched in the project settings. Usage here will override any defaults, so true would hide the top bar.
If false, prevents new applicants from creating an account. This defaults to true, and like in hide_top_bar the settings can be given a new default in the project settings. Any usage here will then override that default.
For this example, while the potential for customization is extensive, the basic idea is pretty straightforward:
Below is a pared down version of the iframe code.
In words, the script below will...
- Begin the inline script
- Load project 1234567 (section starting with Let rp_vars)
- Hide the top bar
- Authenticate the user
- Prevent them from creating a new user
- Load form 2514736
- Once that form is submitted call a custom function ("Yay, form submitted")
- And the final line is init, which inititializes the global variable REGPACK.