Skip to main content

Animated Form Switching using Bootstrap Framework

Language


Hi sourcecodester,

This is an animated form switching using bootstrap framework. The script will switch between form login and signup page with transition effect.

This code is simple but useful to your future project. To learn more about bootstrap framework please visit http://twitter.github.io/bootstrap/.

Here's the sample code:

  1. <?php
  2. include('header.php');
  3. ?>
  4. <body>
  5. <div class="container">
  6. <script type="text/javascript">
  7. jQuery(document).ready( function () {
  8. $(".form2").hide();
  9.  
  10. $("#click").click( function() {
  11.  
  12. $(".form1").hide();
  13. $(".form2").fadeIn("slow");
  14.  
  15. });
  16.  
  17. $("#click1").click( function() {
  18.  
  19. $(".form2").hide();
  20. $(".form1").fadeIn("slow");
  21.  
  22. });
  23. });
  24. </script>
  25. <br><br>
  26.  
  27. <form class="form-horizontal">
  28.  
  29. <div class="form1">
  30. <div class="control-group">
  31. <label class="control-label" for="inputEmail">FirstName</label>
  32. <div class="controls">
  33. <input type="text" id="inputEmail" placeholder="FirstName" required>
  34. </div>
  35. </div>
  36. <div class="control-group">
  37. <label class="control-label" for="inputPassword">LastName</label>
  38. <div class="controls">
  39. <input type="text" id="inputPassword" placeholder="LastName" required>
  40. </div>
  41. </div>
  42. <div class="control-group">
  43. <label class="control-label" for="inputPassword">MiddleName</label>
  44. <div class="controls">
  45. <input type="text" id="inputPassword" placeholder="MiddleName" required>
  46. </div>
  47. </div>
  48. <div class="control-group">
  49. <label class="control-label" for="inputPassword">Address</label>
  50. <div class="controls">
  51. <input type="text" id="inputPassword" placeholder="Address" required>
  52. </div>
  53. </div>
  54.  
  55. <div class="control-group">
  56. <label class="control-label" for="inputEmail">Username</label>
  57. <div class="controls">
  58. <input type="text" id="inputEmail" placeholder="Username" required>
  59. </div>
  60. </div>
  61. <div class="control-group">
  62. <label class="control-label" for="inputPassword">Password</label>
  63. <div class="controls">
  64. <input type="password" id="inputPassword" placeholder="Password" required>
  65. </div>
  66. </div>
  67.  
  68. <div class="control-group">
  69. <div class="controls">
  70.  
  71. <button type="submit" class="btn btn-info">Sign Up</button>
  72. </div>
  73. </div>
  74. <a href="#" id="click">Click Here to login</a>
  75. </div>
  76.  
  77. <div class="form2">
  78. <div class="control-group">
  79. <label class="control-label" for="inputEmail">Username</label>
  80. <div class="controls">
  81. <input type="text" id="inputEmail" placeholder="Username" required>
  82. </div>
  83. </div>
  84. <div class="control-group">
  85. <label class="control-label" for="inputPassword">Password</label>
  86. <div class="controls">
  87. <input type="password" id="inputPassword" placeholder="Password" required>
  88. </div>
  89. </div>
  90.  
  91. <div class="control-group">
  92. <div class="controls">
  93. <label class="checkbox">
  94. <input type="checkbox" required> Remember me
  95. </label>
  96. <button type="submit" class="btn btn-success">Login</button>
  97. </div>
  98. </div>
  99. <a href="#" id="click1"> Click Here to Sign Up</a>
  100. </div>
  101.  
  102. </form>
  103. </div>
  104. </body>
  105. </html>

For question about this code email me at [email protected] thank you.

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:

1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

Add new comment

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.