Submit text field with paragraphs

Team

I am inserting 5 paragraphs of text in a form and wanting to pull the 5 paragraphs into a page with paragraph formatting in tact. At the moment all the text inserting is going in and stripping the paragraphs so I’m pulling one chunk of text. Is there a way I can save the intended format and then pull it to display?

Hello Charles. When you submit text with line breaks in a paragraph field (textarea) the text is stored exactly like that in the database. Here’s a screenshot of a form I submitted and how the textarea paragraphs are stored:

If it’s displaying all in one chunk without line breaks, it’s probably due to the way you are retrieving that or displaying it. Can you explain how you get that information to display once the form has been submitted?

Chris

This is the call on table data

$result_campaign = $wpdb->get_results(“SELECT meta_value FROM wp_gf_entry_meta WHERE form_id=‘87’ and meta_key=‘6’ and entry_id='”.$result->entry_id.“'”);

This is the display code

".$result_campaign[0]->meta_value."

and this is the result

Chris

Hey Charles,

You probably need to wrap the meta value in the wpautop() function to get the formatting you want: wpautop() | Function | WordPress Developer Resources

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