content logo

Bootstrap Accordions:

Accordion Form with Bootstrap

Accordions have many useful benefits in a website and many website owners use these handy features to improve the quality and performance of their site. Usually lengthy pages with lots of content benefit the most from an accordion. Using the element will reduce the amount of scrolling needed hence, the page appearing shorter than it is. The headers give the users some sort of clue of what they are going to read about and whether they want to read that particular section or not. This can be quite satisfying to the users as it will minimize the time needed to find what they needed. Since some of the content is hidden until the user expands the respective accordion, the page looks much cleaner. Besides, not all of the content load simultaneously and therefore the page is much faster as well.

Accordions can also be used in Bootstrap forms. Accordion forms work similar to normal accordions but instead of text, accordions contain sections of forms. This usage takes up a lot less physical space inside your website and makes the form appear shorter which let's be honest, we all hate long and complicated ones. All in all, this simple accordion form is perfect when you have multiple lengthy forms and want to hide the length of it. Also, you can get these Bootstrap accordions for free right now.

 

#

Bootstrap Forms

#

Accordion Forms

#

Bootstrap Accordion

#

Simple Accordion Forms

<!-- This script got from frontendfreecode.com -->
<div class="container">
    <div class="panel-group" id="searchAccordion">
        <div class="panel panel-default">
            <div class="panel-heading">
                <a class="accordion-toggle" data-toggle="collapse" data-parent="#searchAccordion" href="#collapseOne">Search</a>
            </div>
            <div id="collapseOne" class="panel-collapse collapse in">
                <div class="panel-body">
                    <div class="row">
                        <form>
                            <label>Postcode</label> <input class="input-medium" type="text" /><br />
                            <label>ID</label> <input class="input-medium" type="text" /><br />
                            <label>Region</label> <input class="input-medium typeahead" id="taRegion" type="text" data-provide="typeahead" autocomplete="off" /><br />
                            <label> <input type="checkbox" /> Include completed? </label><br />
                            <label> <input type="checkbox" /> Include cancelled? </label>
                        </form>
                    </div>
                </div>
            </div>
        </div>

        <div class="panel panel-default">
            <div class="panel-heading">
                <a class="accordion-toggle" data-toggle="collapse" data-parent="#searchAccordion" href="#collapseTwo">Advanced Options</a>
            </div>
            <div id="collapseTwo" class="panel-collapse collapse">
                <div class="panel-body">
                    <div class="row">
                        <form class="form-inline">
                            <label>Address</label> <input class="input-large" type="text" /><br />
                            <label>Assessor</label> <input class="input-medium typeahead" id="taAssessor" type="text" data-provide="typeahead" autocomplete="off" /><br />
                            <label>Client</label> <input class="input-large typeahead" id="taClient" type="text" data-provide="typeahead" autocomplete="off" /><br />
                            <label>Status</label> <input class="input-medium typeahead" id="taStatus" type="text" data-provide="typeahead" autocomplete="off" /><br />
                            <label>Type</label> <input class="input-large typeahead" id="taType" type="text" data-provide="typeahead" autocomplete="off" /><br />
                            <label>Department</label> <input class="input-medium typeahead" id="taDepartment" type="text" data-provide="typeahead" autocomplete="off" /><br />
                            <label>Client Ref</label> <input class="input-small" type="text" /><br />
                            <label>PO Number</label> <input class="input-small" type="text" />
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div><a style="font-size: 8pt; text-decoration: none" target="_blank" href="http://frontendfreecode.com">Free Frontend</a>
                                                                            
.accordion-toggle {
    display: block;
}
.panel-body {
    padding: 30px;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- This script got from frontendfreecode.com -->

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<style>
.accordion-toggle {
    display: block;
}
.panel-body {
    padding: 30px;
}
</style>

</head>
<body>
<div class="container">
    <div class="panel-group" id="searchAccordion">
        <div class="panel panel-default">
            <div class="panel-heading">
                <a class="accordion-toggle" data-toggle="collapse" data-parent="#searchAccordion" href="#collapseOne">Search</a>
            </div>
            <div id="collapseOne" class="panel-collapse collapse in">
                <div class="panel-body">
                    <div class="row">
                        <form>
                            <label>Postcode</label> <input class="input-medium" type="text" /><br />
                            <label>ID</label> <input class="input-medium" type="text" /><br />
                            <label>Region</label> <input class="input-medium typeahead" id="taRegion" type="text" data-provide="typeahead" autocomplete="off" /><br />
                            <label> <input type="checkbox" /> Include completed? </label><br />
                            <label> <input type="checkbox" /> Include cancelled? </label>
                        </form>
                    </div>
                </div>
            </div>
        </div>

        <div class="panel panel-default">
            <div class="panel-heading">
                <a class="accordion-toggle" data-toggle="collapse" data-parent="#searchAccordion" href="#collapseTwo">Advanced Options</a>
            </div>
            <div id="collapseTwo" class="panel-collapse collapse">
                <div class="panel-body">
                    <div class="row">
                        <form class="form-inline">
                            <label>Address</label> <input class="input-large" type="text" /><br />
                            <label>Assessor</label> <input class="input-medium typeahead" id="taAssessor" type="text" data-provide="typeahead" autocomplete="off" /><br />
                            <label>Client</label> <input class="input-large typeahead" id="taClient" type="text" data-provide="typeahead" autocomplete="off" /><br />
                            <label>Status</label> <input class="input-medium typeahead" id="taStatus" type="text" data-provide="typeahead" autocomplete="off" /><br />
                            <label>Type</label> <input class="input-large typeahead" id="taType" type="text" data-provide="typeahead" autocomplete="off" /><br />
                            <label>Department</label> <input class="input-medium typeahead" id="taDepartment" type="text" data-provide="typeahead" autocomplete="off" /><br />
                            <label>Client Ref</label> <input class="input-small" type="text" /><br />
                            <label>PO Number</label> <input class="input-small" type="text" />
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div><div id="bcl"><a style="font-size:8pt;text-decoration:none;" href="http://www.devanswer.com">Free Frontend</a></div>

</body>
</html>
Preview