PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

How do I get field labels in a pre_submission_filter?

  1. sydeburn

    Hi, I created a gform_pre_submission_filter in which I need to access to the field labels. For example I have the following line:

    if ($_POST['input_13'] == 'Yes') {
    	$q1docs = $q1docs.'--'.$form['fields'][7]['label'];

    This works as expected. But my form is several pages and it is difficult to determine the proper index (i.e. the 7 in $form['fields'][7]['label']) for fields further along in the form.

    I do know the Field ID, but unfortunately the index does not correlate to the field ID. For example the Field ID of $form['fields'][7] is 4, not 7.

    Is there a way to get the label programatically without knowing the index of that field?


    Posted 11 years ago on Friday February 22, 2013 | Permalink