JavaScript Customization
5 min
regpack loads on your website when you https //www regpacks com/help/project settings/embedding regpack/ , and populates with the default properties although this will serve most needs, you are able to fine tune this behavior further using javascript to control when the system populates, and what project settings are active on this load instance 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 parameters true 181 unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type unhandled content type motivating example in this example, as will be the case in most applications of the api, actions from the user endpoint will need to be collected server side and then passed into the javascript the reason why this must occur server side is to maintain the security of your information for instance if you made the login call in the in line script below, that would necessitate exposing your api admin credentials for this example, while the potential for customization is extensive, the basic idea is pretty straightforward • load the regpack iframe js file below is a pared down version of the iframe code • set variables and initiate the iframe in words, the script below will begin the inline script server side, you will be responsible for using login at the users endpoint in order to get token , which you pass in to your javascript in order to authenticate the user 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 html/javascript