Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi igornn,

    There isn’t any way to do this at the moment unless you completely hijack the booking form using the rtb_booking_form_html_pre filter. I don’t recommend this, though, because you’ll break compatibility with some addons and you’ll need to implement a lot of the booking form functionality yourself.

    If you need to target the form itself, the best solution is use the following CSS:

    .rtb-booking-form form {
      ...anything..
    }

    If you’re using a CSS lib like Bootstrap, you’ll probably need to copy the styles you want into that CSS rule.

    Thread Starter igornn

    (@igornn)

    Hi NateWr,
    can you add the some id in the next update?
    it can be “rtb-booking-form” or whatever…

    it can be very useful for us to add ids and classes.

    i need this for google tag manager and my project.

    Thanks

    Hi igornn,

    No, I don’t plan to add any ID to the booking form. IDs can get messy quickly (since they need to be unique). If you need some kind of bespoke implementation with an ID, I’d recommend you just wrap the output in a div with an id attribute, like this:

    <div id="my-booking-form">
    <?php echo do_shortcode('[booking-form]'); ?>
    </div>

    If you need a more consistent way of handling this for a client, you can just overwrite the booking form shortcodde with your own:

    function my_rtb_booking_form_shortcode() {
    	return '<div id="my-booking-form"> . rtb_print_booking_form() . '</div>';
    }
    add_shortcode( 'booking-form', 'my_rtb_booking_form_shortcode' );
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add id and class to form’ is closed to new replies.