Link to home
Start Free TrialLog in
Avatar of chand pb
chand pbFlag for United States of America

asked on

How make a slide down form with bootstrap

Hello,
Is it possible to show me an example of how to create  a slide down example in bootstap that display a form . All the example, I saw just show a drop down with a single selection

I have a login form that I would like to slide down when a button is press on main screen.

Thanks
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

Are you talking about a modal?  http://getbootstrap.com/javascript/#modals

Modals are chunks of html that are hidden until accessed.  Then instead of a pop up or alert, they appear with or without animation.  They can close in the same way.  You can even populate the modal via ajax.  If I am doing a log in form, this is probably what I would use to have something appear when logged out, then "slide down" when the log in button is pressed and the log in works.

<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-whatever="@mdo">Open modal for @mdo</button>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-whatever="@fat">Open modal for @fat</button>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" data-whatever="@getbootstrap">Open modal for @getbootstrap</button>
...more buttons...

<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="exampleModalLabel">New message</h4>
      </div>
      <div class="modal-body">
        <form>
          <div class="form-group">
            <label for="recipient-name" class="control-label">Recipient:</label>
            <input type="text" class="form-control" id="recipient-name">
          </div>
          <div class="form-group">
            <label for="message-text" class="control-label">Message:</label>
            <textarea class="form-control" id="message-text"></textarea>
          </div>
        </form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary">Send message</button>
      </div>
    </div>
  </div>
</div>

Open in new window

Avatar of chand pb

ASKER

I am making a phone application and I don't want to have  a popup dialog..  

What I have in a search result screen  and a filter button in the nav bar. When the button is press, I would like the current content to slide down on page and be disable and the filter screen to be on the top page . The user then make some choices and submit. Then they are back to the original screen with the new results

Thanks you for the sample and link.. . I will have  a look
ASKER CERTIFIED SOLUTION
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for your help..  I will try the modal approach