Placeholder text included in submission

I know that the default is the placeholder text for a field will not be included in the submission, but is it possible to do this?

For example, i have a number field where the user enters the number they want. I would like to see the submission results have the number and a pre-determined placeholder. Placeholder would be “Units” . Someone would enter for example “2” in the field. And the results would show “2 Units”

Hi nurenu. That is not possible by default but you could use the gform_merge_tag_filter to append placeholder text to the value that was submitted. Here is the documentation for the gform_merge_tag_filter filter: gform_merge_tag_filter - Gravity Forms Documentation

With that, you could create a merge tag modifier like “placeholder” and then in your merge tag do this:

{Number of units required:12:placeholder}

And then instead of “2” being returned by the merge tag {Number of units required:12}`, your code would take what was entered, and combine that with the string " Units" so it becomes “2 Units”.

You may have to add additional code if the placeholder is not always “Units”. You could grab the form ID from the $entry[‘form_id’] and then get the $form using the get_form API function. Then you can loop through the form fields to retrieve the placeholder property for the field.

If you have any other questions, please let us know.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.