javascript - Dynamic form field using HTML, and Bootstrap -
i trying create dynamic form field using code site
http://bootsnipp.com/snippets/featured/dynamic-form-fields-add-amp-remove-bs3
here piece of code after modify it
<div class="control-group" id="fields"> <div class="controls"> <form role="form" autocomplete="off"> <div class="entry input-group col-xs-3"> <input class="form-control" name="fields[]" type="text" placeholder="type something" /> <span class="input-group-btn"> <button class="btn btn-success btn-add" type="button"> <span class="glyphicon glyphicon-plus"></span> </button> </span> </div> <!--submit button--> <div class="form-group"> <button type="submit" class="btn btn-default" >search</button> </div> </form> <br> </div> </div>
the problem is, whenever press add field button, new field goes below search button. guess because of div class="controls"
before form. how can solve dynamic field still added above search?
you have got hierarchy of divs or off. comment out current code. copy in html bootsnip make sure works , work backwards before, ie.. customizing it. hope helps, don't have enough information code , works fine bootsnip page. pretty simple code, silly being overlooked. div hierarchy when comes these components.
you know what, move form around everything...? don't have
<div class="control-group" id="fields"> </div>
at highest level.
Comments
Post a Comment