Hi @jjcstudios,
By Text field, I suppose you are referring to the “Input” field. Just to be sure you want to add a line break only inside the “Label” of the field?
By default, due to security any HTML tags added to Input fields “Label”, “Description,” etc will get removed.
Could you please confirm where you are looking to add line breaks ie inside “Label”, “Descriptions” etc so that we could check for any workarounds?
Looking forward to your response.
Kind Regards,
Nithin
Hi Nithin, It would be inside the default value field.
Hi @jjcstudios,
Thanks for explaining further. In this case, the “TextArea” field would be much better to use instead of the “Input” field. Any specific reason to use the “Input” field?
I suppose you are looking to manually style the text for “Default Value”?I’m checking with our developer to see if there is any workaround that could be suggested to allow HTML tags.
Will keep you posted once we get further feedback asap.
Kind Regards,
Nithin
Thank you Nithin. I am trying to use your form as a front end text editor. Where I can put text in that area and let the user make changes to the text and then submit to me. Unless you recommend another plug-in that can do this.
Hi @jjcstudios,
You can try this snippet and see whether it helps:
<?php
add_filter( 'forminator_field_text_markup', 'wpmudev_render_textarea_break', 10, 2 );
function wpmudev_render_textarea_break( $html, $field ) {
if ( strpos( $html, '{line_br}' ) !== false ) {
$html = str_replace('{line_br}', '
', $html);
}
return $html;
}
The above code can be added as a mu-plugins. Please check this link on how to implement the above code as a mu-plugins:
https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins
Once the code is added you’ll need to add {line_br} for linebreak:
Screenshot at 09:59:37.png
Please do note that the above snippet will only work for “TextArea” field.
Kind Regards,
Nithin