bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Modal form submit in IE9 workaround - add'l info for #566

Open BizSherpa opened this issue 15 years ago • 3 comments

A modal form consisting of modal-header, modal-body and modal footer.

form fields in modal-body, submit button in modal-footer. Works in FF, Chrome, Safari - does not work in IE9

Workaround #1: place submit button in modal-body (ugh) Workaround#2: change submit button to type=button and add an onclick event to document.modalform.submit()

BizSherpa avatar Nov 10 '11 14:11 BizSherpa

I'm not quite sure why you are having this issue, but I am doing a form post from a modal and it works fine with IE9. Here's a snippet of one of mine that works:

<div id="create" class="modal hide" style="display: none;">
  <div class="modal-header">
    <a href="#" class="close">×</a>
    <h3>
      Title</h3>
  </div>
  <form action="/post/url" class="form-stacked" method="post" style="margin: 0; padding: 0;">
    <div class="modal-body">
      <label for="Name">Name</label>
      <input autofocus="autofocus" id="Name" name="Name" type="text" value="" />
    </div>
    <div class="modal-footer">
      <input type="submit" value="Add " class="btn primary" />
    </div>
  </form>
</div>

mkchandler avatar Nov 12 '11 00:11 mkchandler

It was user error. I had the beginning form tag just inside the div for modal-body, after I followed your example and wrapped modal-body and modal-footer with the form tags it worked like a charm. Thanks so much.

BizSherpa avatar Nov 12 '11 01:11 BizSherpa

The same problem but thanks to mkchandler for providing us a correct way. However, it makes more sense to me with BizSherpa way when I did just like BizSherpa from the first time.

effectjam avatar Dec 14 '11 15:12 effectjam