Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // http://www.gravityhelp.com/forums/topic/change-option-value?replies=19#post-103945
- // change the 241 here to your form ID
- add_action('gform_pre_submission_filter_241', 'strip_pricing');
- function strip_pricing($form) {
- // split input_1 on the pipe symbol and use the first part
- $haystack = $_POST['input_1'];
- $needle = '|';
- $result = substr($haystack, 0, strpos($haystack, $needle));
- // assign the result to the hidden field in the form
- // update the 58 here to the ID of your hidden field
- $_POST['input_58'] = $result;
- // return the form
- return $form;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement