My process:
- First I designed a signup form for my website using Bootstrap
- Then, I created a signup form using MailChimp, so I can track and contact my signups
- I then generated the embed form HTML markup, and combined the two
The issue:
The part that is breaking the form is that the Bootstrap radio button toggle uses input type="button" and the MailChimp form I am trying to map it to uses type="radio".
If I don't use type="radio", the submission works but when I check the information on my subscribers in MailChimp, I am missing data from that part of the form on.
If I use type="radio", the form prematurely submits when the user tries to use the toggle button, so basically the form submits before they can finish filling out the rest of the form.
JSFiddle Demo of the issue is here: http://jsfiddle.net/halsey/qwPzy/9/
The solution?
I am aware of threads like this, which say you will need to override this behavior with javascript, but I can't find an example of how to do this.
I'm sure this is embarrassingly easy but I am having trouble locating resources to help me learn how to fix this. Thanks in advance for any help you can provide.
Footnote
StackOverflow is preventing me from linking to JSFiddle without embedding code. I would encourage you to use the link above, but my broken attempt at embedding the code is below. Apologies for the weird formatting but I am having trouble embedding the code in one chunk - I am a StackOverflow beginner.
HTML:
<form action="http://foorder.us6.list-manage1.com/subscribe/post?u=81c3da3b3ebbf564cf50a78ff&id=f16451f556" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<fieldset class="mc-field-group">
<div class="form-field input-prepend">
<span class="add-on">http://Foorder.com/</span>
<input class="span3 required" id="prependedInput mce-MMERGE2" type="text" placeholder="YourProfile" value="" name="MMERGE2">
</div><!-- / .formfield .input-prepend -->
<div class="form-field">
<input type="email" class="span3 required email" placeholder="Email" value="" name="EMAIL" id="mce-EMAIL">
<input type="text" class="span2 required" placeholder="Zip Code" value="" name="MMERGE8" id="mce-MMERGE8">
</div><!-- / .formfield -->
<div class="form-field">
I want to
<div class="btn-group" data-toggle="buttons-radio">
<button type="radio" class="btn" value="Buy" name="MMERGE3" id="mce-MMERGE3-0">Buy</button>
<button type="radio" class="btn" value="Sell" name="MMERGE3" id="mce-MMERGE3-1">Sell</button>
</div>
items on Foorder
</div><!-- / .formfield -->
<div class="form-field">
<button type="button" class="btn btn-link" data-toggle="collapse" data-target="#promo-code-toggle">
Have a promo code?
</button>
<div id="promo-code-toggle" class="collapse">
<input type="text" class="span2" placeholder="Promo Code" value="" name="MMERGE1 promocodeinput" id="mce-MMERGE1 promo-code-input">
</div><!-- / .formfield -->
</div><!-- / .formfield -->
<div id="mce-responses" class="clear">
<div class="response" id="mce-error-response" style="display:none"></div>
<div class="response" id="mce-success-response" style="display:none"></div>
</div>
<div class="form-field">
<button type="submit" class="button btn btn-primary" value="Subscribe" name="subscribe" id="mc-embedded-subscribe">Submit</button>
</div><!-- / .formfield -->
</fieldset>
</form>
CSS HEAD links:
<link href="http://fonts.googleapis.com/css?family=Ubuntu" rel="stylesheet">
<link href="http://foorder.com/_Resources/SBX/css/bootstrap.css" rel="stylesheet">
<link href="http://foorder.com/_Resources/SBX/css/bootstrap-responsive.css" rel="stylesheet">
Javascript BODY links:
<script src="http://foorder.com/_Resources/SBX/js/jquery.js"></script>
<script src="http://foorder.com/_Resources/SBX/js/bootstrap-transition.js"></script>
<script src="http://foorder.com/_Resources/SBX/js/bootstrap-alert.js"></script>
<script src="http://foorder.com/_Resources/SBX/js/bootstrap-modal.js"></script>
<script src="http://foorder.com/_Resources/SBX/js/bootstrap-dropdown.js"></script>
<script src="http://foorder.com/_Resources/SBX/js/bootstrap-scrollspy.js"></script>
<script src="http://foorder.com/_Resources/SBX/js/bootstrap-tab.js"></script>
<script src="http://foorder.com/_Resources/SBX/js/bootstrap-tooltip.js"></script>
<script src="http://foorder.com/_Resources/SBX/js/bootstrap-popover.js"></script>
<script src="http://foorder.com/_Resources/SBX/js/bootstrap-button.js"></script>
<script src="http://foorder.com/_Resources/SBX/js/bootstrap-collapse.js"></script>
<script src="http://foorder.com/_Resources/SBX/js/bootstrap-carousel.js"></script>
<script src="http://foorder.com/_Resources/SBX/js/bootstrap-typeahead.js"></script>
<script src="http://foorder.com/_Resources/SBX/js/bootstrap-affix.js"></script>
<script src="http://foorder.com/_Resources/SBX/js/holder/holder.js"></script>
<script src="http://foorder.com/_Resources/SBX/js/google-code-prettify/prettify.js"></script>
<script src="http://foorder.com/_Resources/SBX/js/application.js"></script>
<script src="http://foorder.com/_Resources/SBX/js/custom.js"></script>