• Is there a way to add the value of a custom field to a form? What I want to do is add a reference number to the subject line (or include it elsewhere in the form) from a Custom Field on the page where the form is used.

    I hope that makes sense.

Viewing 6 replies - 1 through 6 (of 6 total)
  • I do not think so. It could be done with PHP code changes if you want to.

    Mike

    Oh yea, you might be able to with this:
    Setting optional extra hidden fields with shortcode:
    https://www.fastsecurecontactform.com/shortcode-options

    Thread Starter dibbit

    (@dibbit)

    Thanks Mike – I actually did it in the end by making a small change to the PHP, so that the subject line has a custom field value tacked on.

    BTW best contact form plugin I have found.

    Dibbit, can you post the changes you made to the code to allow custom field values?

    I’m using a plugin called Contact Form to DB Extension that puts form submissions into a table. Problem is, the VALUE of all the extra fields say ex_field1, ex_field2, etc. Not very helpful when viewing the database.

    Thread Starter dibbit

    (@dibbit)

    Hi Jenn

    Here is the code snippet I changed. Its in si-contact-form/si-contact-form.php in Version 2.9.8.4. You will need to change the custom field name to whatever you are using. I don’t know if the code has changed in later versions of the plugin.

    global $post;
      if ( 1 /*$si_contact_opt['email_subject'] == get_option('blogname') . ' ' .'Contact:'*/) {
          $si_contact_opt['email_subject'] =  'PUT YOUR WEBSITE NAME HERE ' .__('Contact ', 'si-contact-form') . "Ref: " . get_post_meta( $post->ID, "Reference", true) ;
          $si_contact_option_defaults['email_subject'] = $si_contact_opt['email_subject'];
      }

    To find the code search for the line I have commented out. Hope that helps.

    Hi Jenn,
    Did you solve the problem?
    I have the same condition like you; I’m also using a Plugin called “Contact Form to DB Extension” that puts form submissions into a table. Problem is, the VALUE of all the extra fields name say ex_field1, ex_field2, ex_field2, etc. it is NOT very helpful when user viewing the database.
    Please let me know, if you solve your problem. I appreciate that!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: Fast Secure Contact Form] Adding custom field data to contact form’ is closed to new replies.