0

Is it possible to put a simple form submit button inside the bootstrap popover on button click.

I have my devise sign up form inside a bootstrap modal. The sign up form is done with simple form.

The submit button is:

<div class="form-actions">
    <%= f.button :submit, "Sign up" %>
</div>

I want to add a popover so when the user clicks sign up, the get a popover with a message along the following lines.

<button type="button" class="btn btn-default" data-container="body" data-toggle="popover" data-placement="right" data-content="Thanks! We've received your details and will be in contact soon to get started.">
    Sign up
</button>

Can I change the tag from <button type> to a div class with all the elements for the popover and put that inside the f.button? I saw simple form has initialisers for some bootstrap functions - but it seems that a popover isn't one of them.

Thank you

toniedzwiedz
  • 17,895
  • 9
  • 86
  • 131
Mel
  • 2,481
  • 26
  • 113
  • 273
  • possible duplicate of [Is it possible to use a div as content for Twitter's Popover](http://stackoverflow.com/questions/8875376/is-it-possible-to-use-a-div-as-content-for-twitters-popover) – pennstatephil Jun 04 '14 at 20:39
  • Thanks pennstatephil. I searched for using div tags before posting the question. I want to use the functionality of the bootstrap popover without writing custom JS. That's why I'm asking. I thought maybe I had missed something to link them together. Any help you can offer would be appreciated. – Mel Jun 04 '14 at 20:44
  • you still need to initialize the element as popover. I.e. `$('button').popover();` – blurfus Jun 04 '14 at 21:07
  • Thank you bluffs. Yes, I can see that, but I don't know how to style the submit button in simple form to activate that js. Please could you give me the step to put the bootstrap popover into the simple form submit button. Thank you very much – Mel Jun 04 '14 at 21:10

0 Answers0