How to put a form in a popover using the bootstrap platform?

What I want to do is put a simple form in a popover, now my popover works fine, but it doesn't work when I put the form inside a popover.

here is my conclusion

enter image description here

here is my code

<a href="#" class="btn" rel="popover" data-placement="bottom" data-content=" <form class='form-horizontal'> <div class='control-group'> <label class='control-label' for='inputEmail'>Start Date</label> <div class='controls'> <input type='text' class='span3 ' name='start_date' id='start_date' placeholder='News Date' value='<?php echo date('dm-Y'); ?>' > </div> </div> <div class='control-group'> <label class='control-label' for='inputEmail'>End Date</label> <div class='controls'> <input type='text' id='end_date' name='end_date' placeholder='End Date' class='input-xlarge uneditable-input'> </div> </div> </form>" title="Popover on bottom"> </a> 

here is the url that taught me did something like this Contains a form in a boot popover?

my version of the initial version was 2.2.2, any idea how to solve my problem? thanks

+6
source share
2 answers

You can set data-html="true" in the <a> tag that contains the popover

+8
source

check this jsfiddle, I used 3 simple buttons: here

i copied my html code in jquery variable:

 var mycontent='<div class="btn-group"> <button class="btn">Left</button> <button class="btn">Middle</button> <button class="btn">Right</button> </div>' 

it works fine even if you remove html: true,

0
source

All Articles