Executing Script via Custom Field

Support MB Frontend Submission Executing Script via Custom Field

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #48253
    johnsonmr90@gmail.com[email protected]
    Participant

    The use case:
    I have a site where users create profiles using a frontend submission form. One of the custom fields is for an external booking tool script that embeds a booking calendar on the site.

    The builder:
    Bricks Builder

    The problem:
    I have used a shortcode element and a code element in an effort to pass through the script that is accepted via a Textarea custom field in MB, with sanitization set to "none," but I am not able to render the code on the front-end. The shortcode element does not require code signing, while the code element does. I have tried every permutation when it comes to toggling parsing dynamic data, do not use a <div> wrapper, etc.

    If I inject the code directly in a code element AND I call the custom field value in a shortcode or code element, the result is multiple instances of the code executing, thereby showing multiple calendars. But when I remove that code element with the script directly inserted, nothing shows.

    The solution:
    I am looking for the path of least resistance when it comes to accepting a <script> code snippet as a custom field and displaying the given code on the front-end using Meta Box and Bricks Builder

    #48256
    PeterPeter
    Moderator

    Hello Johnson,

    Thanks for reaching out.

    I'm not sure how you use shortcode and code element on your site with Bricks builder but I see that if you use the PHP code to output the field value, it works properly

    echo rwmb_meta( 'textarea_field');

    You can contact Bricks support and ask them for more information.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.