• Resolved sansolo

    (@sansolo)


    Hi, I need custom action for which I found some help. However, I need some help in accessing t he fields in the submitted form. For example, I have a field Phone Number(this is the only field in my form). How can I access it in this code?

    function wpf_custom_form_action( $action, $form_data) {	
    	
        if ( $form_data[ 'id' ] == '168' ) {
     
         return 'facebook.com';
     
        }
     
        return $action;
    }
     
    add_filter( 'wpforms_frontend_form_action', 'wpf_custom_form_action', 10, 2 );

    Thanks in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter sansolo

    (@sansolo)

    I used print_r to show what form_data has. Still don’t know how to get the one text field in my form. This is the result of print_r

    Array ( [fields] => Array ( [2] => Array ( [id] => 2 [type] => text [label] => Phone Number [description] => [size] => medium [placeholder] => Phone Number [limit_count] => 1 [limit_mode] => characters [default_value] => [input_mask] => [css] => [label_hide] => 1 ) ) [id] => 168 [field_id] => 3 [settings] => Array ( [form_title] => Whatsapp [form_desc] => [submit_text] => Submit [submit_text_processing] => Sending… [form_class] => [submit_class] => [notification_enable] => 1 [notifications] => Array ( [1] => Array ( [email] => {admin_email} [subject] => New Anysapp Entry [sender_name] => Anysapp [sender_address] => {admin_email} [replyto] => [message] => {all_fields} ) ) [confirmations] => Array ( [1] => Array ( [type] => message [message] =>
    Thanks for contacting us! We will be in touch with you shortly.
    
    [message_scroll] => 1 [page] => 71 [redirect] => ) ) [antispam] => 1 [form_tags] => Array ( ) ) [meta] => Array ( [template] => blank ) )

    Hey @sansolo – Thanks for reaching out!

    I apologize as customizations like this are outside of our scope for support. In case you’d like to look into custom development options, we highly recommend using Codeable.

    Thanks!

    Plugin Support Ralden Souza

    (@rsouzaam)

    Hi @sansolo,

    I’m Ralden, and I’ll be filling in for Prashant as he’s currently not available.

    We haven’t heard back from you in a few days, so I’m going to go ahead and close this thread for now. But if you’d like us to assist further, please feel welcome to continue the conversation.

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to access submitted fields in custom action?’ is closed to new replies.