Advertisement
Guest User

Issues with BootstrapValidator.js

a guest
Nov 24th, 2014
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.08 KB | None | 0 0
  1. <?php
  2.     session_start();
  3.     include("dir.php");
  4.    
  5.     if (isset($_POST['submit'])) {
  6.         // FORM SUBMIT CODE HERE
  7.         // FORM SUBMIT CODE HERE
  8.         // FORM SUBMIT CODE HERE
  9.         // FORM SUBMIT CODE HERE
  10.     }
  11.     include($DOCROOT."head-defaults.php");
  12. ?>
  13. <!-- ////////////////////////////////////////////////////
  14.     ////////// Append the styles and scripts to the head -->
  15. <script>
  16.     $('head').append("<link href='<?php echo $DOCROOT; ?>assets/bootstrapvalidator-dist-0.5.3/js/bootstrapValidator.js' rel='stylesheet'>");
  17. </script>
  18.     <style>
  19.         body{
  20.             padding-top: 0px;
  21.             background: url("<?php echo $DOCROOT; ?>assets/images/bg4.jpg");
  22.             background-color: #525252;
  23.         }
  24.         .navbar .btn {
  25.             margin-left: 3px;
  26.         }
  27.        
  28.         .navbar {
  29.             margin-bottom: 0px;
  30.         }
  31.         .centered-form{
  32.             margin-top: 60px;
  33.         }
  34.  
  35.         .centered-form .panel{
  36.             background: rgba(255, 255, 255, 0.8);
  37.             box-shadow: rgba(0, 0, 0, 0.3) 20px 20px 20px;
  38.         }
  39.        
  40.         .has-feedback .form-control-feedback {
  41.             top: 0px;
  42.             right: 0;
  43.         }
  44.         .form-horizontal .has-feedback .form-control-feedback {
  45.             top: 0;
  46.             right: 15px;
  47.         }
  48.     </style>
  49.  
  50.     <div class="container">
  51.            
  52.         <div class="row centered-form">
  53.                     <div class="col-xs-12 col-sm-8 col-md-4 col-sm-offset-2 col-md-offset-4">
  54.                         <div class="panel panel-default">
  55.                             <div class="panel-heading">
  56.                                 <h3 class="panel-title">Start using Project Titan <small>It's free!</small></h3>
  57.                             </div>
  58.                             <div class="panel-body">
  59.                                 <form role="form" id="signupForm" action="sign-up.php" method="POST" >
  60.                                 <div class="row">
  61.                                     <div class="col-xs-12 col-sm-6 col-md-6">
  62.                                         <div class="form-group">
  63.                                             <input type="text" name="first_name" id="first_name" class="form-control input-sm" placeholder="First Name" tabindex="1">
  64.                                         </div>
  65.                                     </div>
  66.                                     <div class="col-xs-12 col-sm-6 col-md-6">
  67.                                         <div class="form-group">
  68.                                             <input type="text" name="last_name" id="last_name" class="form-control input-sm" placeholder="Last Name" tabindex="2">
  69.                                         </div>
  70.                                     </div>
  71.                                 </div>
  72.        
  73.                                 <div class="form-group">
  74.                                     <input type="email" name="email" id="email" class="form-control input-sm" placeholder="Email Address" tabindex="3">
  75.                                 </div>
  76.        
  77.                                 <div class="row">
  78.                                     <div class="col-xs-12 col-sm-6 col-md-6">
  79.                                         <div class="form-group">
  80.                                             <input type="password" name="password" id="password" class="form-control input-sm" placeholder="Password" tabindex="4">
  81.                                         </div>
  82.                                     </div>
  83.                                     <div class="col-xs-12 col-sm-6 col-md-6">
  84.                                         <div class="form-group">
  85.                                             <input type="password" name="confirmPassword" id="confirmPassword" class="form-control input-sm" placeholder="Confirm Password" tabindex="5">
  86.                                         </div>
  87.                                     </div>
  88.                                 </div>
  89.                                    
  90.                                     <button type="submit" name="submit" id="submit" class="btn btn-primary btn-block">Register</button>
  91.                                 </form>
  92.                                
  93.                             </div>
  94.                         </div>
  95.                     </div>
  96.                 </div>
  97.         <div class="row col-md-6 col-md-push-3">
  98.         <?php include($DOCROOT."assets/theme/server-response-msg.php"); ?>
  99.         </div>
  100.     </div>
  101. <script>
  102.     $(document).ready(function() {
  103.         $('#signupForm').bootstrapValidator({
  104.             feedbackIcons: {
  105.                 valid: 'glyphicon glyphicon-ok',
  106.                 invalid: 'glyphicon glyphicon-remove',
  107.                 validating: 'glyphicon glyphicon-refresh'
  108.             },
  109.             fields: {
  110.                 password: {
  111.                     validators: {
  112.                         identical: {
  113.                             field: 'confirmPassword',
  114.                             message: 'The password and its confirm are not the same'
  115.                         }
  116.                     }
  117.                 },
  118.                 confirmPassword: {
  119.                     validators: {
  120.                         identical: {
  121.                             field: 'password',
  122.                             message: 'The password and its confirm are not the same'
  123.                         }
  124.                     }
  125.                 },
  126.             }
  127.         });
  128.     });
  129. </script>
  130. </body>
  131. <?php include($DOCROOT."foot-defaults.php"); ?>
  132. <script src="<?php echo $DOCROOT; ?>assets/bootstrapvalidator-dist-0.5.3/js/bootstrapValidator.js"></script>
  133. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement