Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // update the "19" to the ID of your form
- add_filter('gform_pre_submission_filter_19', 'conditional_message');
- function conditional_message($form){
- // update the "3" following "input_" to the ID of your field
- $interest = RGForms::post('input_3');
- // append a different PDF link based on the interest
- // I used values to avoid capitalization and spaces in my values
- switch($interest) {
- case 'beltguard':
- $form['autoResponder']['message'] .= "<a href='http://www.example.com/whitepapers/belt-guards.pdf' title='Download your free Belt Guard whitepaper'>Belt Guards</a></p>";
- break;
- case 'safetyguard':
- $form['autoResponder']['message'] .= "<a href='http://www.example.com/whitepapers/safety-guards.pdf' title='Download your free Safety Guard whitepaper'>Safety Guards</a></p>";
- break;
- case 'catalogue':
- $form['autoResponder']['message'] .= "<a href='http://www.example.com/whitepapers/2011-catalogue.pdf' title='Download your free Catalogue here'>Catalogue</a></p>";
- break;
- }
- // return modified form
- return $form;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement