html - Fieldsets Using Bootstrap Grids -
i have following markup using bootstrap grids:
<form id="store-form" class="user-form"> <div class="row"> <div class="col-sm-6"> <fieldset id="store-form-store-fields"> <label>store nickname</label> <input id="store-nickname-field" type="text" name="nickname" required class="form-control"> </fieldset> </div> <fieldset id="store-form-location-fields"> <div class="col-sm-6"> <label>store address</label> <input id="store-street-field" type="text" name="street" required class="form-control"> </div> <div class="col-sm-6"> <label>city</label> <input id="store-city-field" type="text" name="city" required class="form-control"> </div> <div class="col-sm-3"> <label>state</label> <select id="store-state-field" name="state_id" required class="form-control"> <option>- select state -</option> <option value="ma">massachusetts</option> <option value="ca">california</option> </select> </div> <div class="col-sm-3"> <label>zip code</label> <input id="store-zipcode-field" type="text" name="zipcode" required class="form-control"> </div> </fieldset> </div> <div class="submit-wrapper"> <button id="store-form-submit" type="submit" class="btn btn-primary submit-button">save</button> </div> </form>
as can see, i'm trying use fieldsets group fields 2 groups. need can create backbone.js view each group of fields separately. breaks grid, since have immediate child of .row
isn't column div.
is there way @ make fieldsets work form layed out using bootstrap grids?
edit clarification: goal layout behave same if fieldsets removed example.
what wrapping second <fieldset>
in div.col-md-6
, putting contents of second <fieldset>
in div.row
? way not skipping css column definition. let me know if helps.
update:
i modified code use responsive resets , col-md-pull
/col-sm-pull
. seems remain responsive. may closest solution possible not able close col definition <div>
within fieldset proper clearing.
http://jsfiddle.net/s9baun7c/4/
<form id="store-form" class="user-form"> <div class="row"> <div class="col-sm-6"> <fieldset id="store-form-store-fields"> <label>store nickname</label> <input id="store-nickname-field" type="text" name="nickname" required class="form-control" /> </fieldset> </div> <fieldset id="store-form-location-fields"> <div class="col-sm-12"> <label>store address</label> <input id="store-street-field" type="text" name="street" required class="form-control" /> </div> <div class="clearfix visible-md-block"></div> <div class="clearfix visible-sm-block"></div> <div class="row"> <div class="col-md-12"> <div class="col-sm-12 col-sm-pull-12 col-sm-pull-12"> <label>city</label> <input id="store-city-field" type="text" name="city" required class="form-control" /> </div> <div class="clearfix visible-md-block"></div> <div class="clearfix visible-sm-block"></div> <div class="col-sm-6 col-sm-pull-12 col-sm-pull-12"> <label>state</label> <select id="store-state-field" name="state_id" required class="form-control"> <option>- select state -</option> <option value="ma">massachusetts</option> <option value="ca">california</option> </select> </div> <div class="col-sm-6 col-sm-pull-12 col-sm-pull-12"> <label>zip code</label> <input id="store-zipcode-field" type="text" name="zipcode" required class="form-control" /> </div> </div> </div> </fieldset> </div> <br> <div class="submit-wrapper"> <button id="store-form-submit" type="submit" class="btn btn-primary submit-button">save</button> </div> </form>
Comments
Post a Comment