Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // http://www.gravityhelp.com/forums/topic/merger-tags-use-part-of-a-tag
- // change the 9 in the next line to your form ID
- add_action('gform_pre_submission_9', 'custom_company_id');
- function custom_company_id($form){
- // change the 5 part of 'input_5' here to the field ID where you want to store the 8 character company name
- // change the 2 part of 'input_2' at the end to the field ID where the full company name was submitted
- // this will strip out all whitespace, then return the first 8 characters
- $_POST['input_5'] = substr(preg_replace('/\s+/', '', rgpost('input_2')), 0, 8);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement