Giter VIP home page Giter VIP logo

Comments (8)

doganmeh avatar doganmeh commented on July 25, 2024 1

Try 'buttons layout="horizontal"'

This behavior does not seem to be documented. Should it be?

from django-bootstrap3.

dyve avatar dyve commented on July 25, 2024

Did you wrap this in

<form class="form form-horizontal"> ... </form>

?

from django-bootstrap3.

mociepka avatar mociepka commented on July 25, 2024

Yes. I used:

<form class="form-horizontal" role="form">...</form>

from django-bootstrap3.

dyve avatar dyve commented on July 25, 2024

Can you post the HTML generated?

from django-bootstrap3.

mociepka avatar mociepka commented on July 25, 2024

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">&nbsp;</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.

dyve avatar dyve commented on July 25, 2024

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:

Email
Password
ย 
Remember me
Sign in

The 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.

mociepka avatar mociepka commented on July 25, 2024

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.

dyve avatar dyve commented on July 25, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.