6

What I want to do is put a simple form in popover,Now my popover was working fine, but it's not working when I put the form inside the popover.

here is my output

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('d-m-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 who teach me did something like this Contain form within a bootstrap popover?

my bootstrap version was 2.2.2, any idea how to solve my problem? thanks

Community
  • 1
  • 1
Oscar
  • 1,093
  • 4
  • 21
  • 31
  • possible duplicate of [Contain form within a bootstrap popover?](http://stackoverflow.com/questions/12128425/contain-form-within-a-bootstrap-popover) – HaNdTriX Apr 06 '14 at 16:41

2 Answers2

8

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

PerfectlyNormal
  • 4,182
  • 2
  • 35
  • 47
0

check out this jsfiddle, i used 3 simple buttons: here

i copyed my html code in a 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,

PersianMan
  • 2,779
  • 2
  • 17
  • 20