Comments (8)
Try 'buttons layout="horizontal"'
This behavior does not seem to be documented. Should it be?
from django-bootstrap3.
Did you wrap this in
<form class="form form-horizontal"> ... </form>
?
from django-bootstrap3.
Yes. I used:
<form class="form-horizontal" role="form">...</form>
from django-bootstrap3.
Can you post the HTML generated?
from django-bootstrap3.
From:
<form class="form-horizontal" role="form">
{% bootstrap_form forms.small layout='horizontal' %}
{% buttons %}
{% bootstrap_button 'Sign in' 'submit' %}
{% endbuttons %}
</form>
I am getting:
<form class="form-horizontal" role="form">
<div class="form-group">
<label class="col-md-2 control-label">Email</label>
<div class="col-md-4">
<input class="form-control" id="id_email" name="email" placeholder="Email" title="" type="text">
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">Password</label>
<div class="col-md-4">
<input class="form-control" id="id_password" name="password" placeholder="Password" title="" type="password">
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label"> </label>
<div class="col-md-4">
<div class="checkbox">
<label>
<input class="" id="id_remember_me" name="remember_me" placeholder="" title="" type="checkbox">
Remember me</label>
</div>
</div>
</div>
<div class="form-group">
<button class="btn btn-primary" type="submit">
Sign in
</button>
</div>
</form>
The problem is column offset. Buttons group should have offset within horizontal form. But the buttons
tag doesn't have horizontal
option.
from django-bootstrap3.
Try 'buttons layout="horizontal"'
Op 13 okt. 2013 om 10:53 heeft Michaล Ociepka [email protected] het volgende geschreven:
From:
{% bootstrap_form forms.small layout='horizontal' %} {% buttons %} {% bootstrap_button 'Sign in' 'submit' %} {% endbuttons %}I am getting:
PasswordยRemember meSign inThe problem is column offset. Buttons group should have offset within horizontal form. But the buttons tag doesn't have horizontal option.
โ
Reply to this email directly or view it on GitHub.
from django-bootstrap3.
Yep now it works. What do you think about more nested structure?
{% bootstrap_form forms.small layout='horizontal' %}
{% buttons %}
{% bootstrap_button 'Sign in' 'submit' %}
{% endbuttons %}
{% endbootstrap_form %}
All buttons, inputs have to be inside bootstrap_form
then you don't have to put the same data into all others tags.
from django-bootstrap3.
Django syntax isn't used to a form being a block, so I think that would confuse people. For now you'll have to provide the buttons with a layout.
from django-bootstrap3.
Related Issues (20)
- Fix simple typo: attrivute -> attribute
- dynamic tabs HOT 1
- Label suffix render HOT 3
- Distinguish between errors and help text
- Move to Zostera HOT 1
- how to use my own templates by Django-bootstrap3
- Bootstrap alert with <br> tag HOT 1
- Tt HOT 2
- Add tests to PyPI sdist HOT 7
- Field's `show_hidden_initial` property is not being respected HOT 3
- Docs not updated for 21.1 HOT 1
- Upgrade importlib_metadata
- cannot create floating labels HOT 3
- Git tags missing since 21.2 HOT 1
- Coveralls service not working HOT 1
- Use mistune >= 2
- Inline radio buttons and inline checkboxes not working in Django 4 HOT 1
- Inline radio buttons and checkboxes lack spacing HOT 1
- Template folder not in package contents
- Template tags and filters docs broken HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-bootstrap3.