HIPAA FORMS CUSTOM CALLBACK EXAMPLE ------------------------------------ This example will get the first name from the form and pass it to the redirected URL. We will include as part of the example information for an optional paramater set within the form settings. You can then pull these parameters on the new page with a second Javascript function to be used however you need. For example, you could populate fields in a secondary form on the new page. This example with pass to a Thank You page URL - First Name, Thank you for submitting a form. This example is using Gravity forms, but the process is very similar in Caldera. Working Example of code is included at the end of this document. CAUTION! Using the custom callback option to pass data from the form to a new page will cause the data being passed to no longer be secured via our plugin. While passing the data from one page to another within your site under SSL should remain secure, passing data into a secondary non-secure form will not be secure or HIPAA compliant. We highly recomend NOT passing actual protected health information (PHI) using this method. It is your responsibility to ensure you remain HIPAA compliant using this option. STEP 1: WP Admin Dashboard -> Hipaa Forms -> Settings Tab -> Form Settings Expand the selected form you want to add a custom callback to. Select "Success Callback" under the "SUBMIT SUCCESS HANDLER" settings. Add the name of your Javascript function you want to call, in this case the function name is testCallBack. Add optional paramater values to pass to your function separated by comma. In this case we're only going to pass one paramater value "test". Hit save. STEP 2: There are three options as to where to create you function: 1. Open an existing Javascript file within your theme to add your function. 2. Create a new file and enqueue it within your functions.php file with the function. 3. Easiest option is to create it within a HTML field anywhere within you form using ------------------------------------------------------------------------------------------------------------------------------------------------------------ Working Code for First Name example In HTML field within the form using ------------------------------------------------------------------------------------------------------------------------------------------------------------ The following example will display the First Name, Thank you message on the receiving URL page. The first line is an example of how to implement styling. message2 - you can change the message to meet your requirements There are a couple of console.log commands to help with testing. ------------------------------------------------------------------------------------------------------------------------------------------------------------