Search code examples
javascriptjquerytwitter-bootstraptwitter-bootstrap-3popover

Contain form within a bootstrap popover?


<div class="container">
    <div class="row" style="padding-top: 240px;">
        <a href="#" class="btn btn-large btn-primary" rel="popover"
            data-content="<form><input type="text"/></form>"
            data-placement="top" data-original-title="Fill in form">Open form</a>
    </div>
</div>

JSfiddle

I'm guessing that I would store the form contents within a javascript function...

How do I contain a form within a bootstrap popover?


Solution

  • Either replace double quotes around type="text" within single quotes, Like:

    "<form><input type='text'/></form>"
    

    OR

    Replace Double quotes wrapping data-content with single quote, Like:

    data-content='<form><input type="text"/></form>'