"reg"
Bootstrap 4.1.1 Snippet by adriano3429

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <link href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <link href="//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-2.1.3.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <form class="form-horizontal" role="form"> <h2>Registration</h2> <div class="form-group"> <label for="firstName" class="col-sm-3 control-label">First Name</label> <div class="col-sm-9"> <input type="text" id="firstName" placeholder="First Name" class="form-control" autofocus> </div> </div> <div class="form-group"> <label for="lastName" class="col-sm-3 control-label">Last Name</label> <div class="col-sm-9"> <input type="text" id="lastName" placeholder="Last Name" class="form-control" autofocus> </div> </div> <div class="form-group"> <label for="email" class="col-sm-3 control-label">Email* </label> <div class="col-sm-9"> <input type="email" id="email" placeholder="Email" class="form-control" name= "email"> </div> </div> <div class="form-group"> <label for="password" class="col-sm-3 control-label">Password*</label> <div class="col-sm-9"> <input type="password" id="password" placeholder="Password" class="form-control"> </div> </div> <div class="form-group"> <label for="password" class="col-sm-3 control-label">Confirm Password*</label> <div class="col-sm-9"> <input type="password" id="password" placeholder="Password" class="form-control"> </div> </div> <div class="form-group"> <label for="birthDate" class="col-sm-3 control-label">Date of Birth*</label> <div class="col-sm-9"> <input type="date" id="birthDate" class="form-control"> </div> </div> <div class="form-group"> <label for="phoneNumber" class="col-sm-3 control-label">Phone number </label> <div class="col-sm-9"> <input type="phoneNumber" id="phoneNumber" placeholder="Phone number" class="form-control"> <span class="help-block">Your phone number won't be disclosed anywhere </span> </div> </div> <div class="form-group"> <label for="Height" class="col-sm-3 control-label">Height* </label> <div class="col-sm-9"> <input type="number" id="height" placeholder="Please write your height in centimetres" class="form-control"> </div> </div> <div class="form-group"> <label for="weight" class="col-sm-3 control-label">Weight* </label> <div class="col-sm-9"> <input type="number" id="weight" placeholder="Please write your weight in kilograms" class="form-control"> </div> </div> <div class="form-group"> <label class="control-label col-sm-3">Gender</label> <div class="col-sm-6"> <div class="row"> <div class="col-sm-4"> <label class="radio-inline"> <input type="radio" id="femaleRadio" value="Female">Female </label> </div> <div class="col-sm-4"> <label class="radio-inline"> <input type="radio" id="maleRadio" value="Male">Male </label> </div> </div> </div> </div> <!-- /.form-group --> <div class="form-group"> <div class="col-sm-9 col-sm-offset-3"> <span class="help-block">*Required fields</span> </div> </div> <button type="submit" class="btn btn-primary btn-block">Register</button> </form> <!-- /form --> </div> <!-- ./container -->
body { background: url('https://static-communitytable.parade.com/wp-content/uploads/2014/03/rethink-target-heart-rate-number-ftr.jpg') fixed; background-size: cover; } *[role="form"] { max-width: 530px; padding: 15px; margin: 0 auto; border-radius: 0.3em; background-color: #f2f2f2; } *[role="form"] h2 { font-family: 'Open Sans' , sans-serif; font-size: 40px; font-weight: 600; color: #000000; margin-top: 5%; text-align: center; text-transform: uppercase; letter-spacing: 4px; }
$(function(){ $.validator.setDefaults({ highlight: function(element){ $(element) .closest('.form-group') .addClass('has-error') }, unhighlight: function(element){ $(element) .closest('.form-group') .removeClass('has-error') } }); $.validate({ rules: { password: "required", birthDate: "required", weight: { required:true, number:true }, height: { required:true, number:true }, email: { required: true, email: true } }, messages:{ email: { required: true, email: true } }, password: { required: " Please enter password" }, birthDate: { required: " Please enter birthdate" }, email: { required: ' Please enter email', email: ' Please enter valid email' }, weight: { required: " Please enter your weight", number: " Only numbers allowed" }, height: { required: " Please enter your height", number: " Only numbers allowed" }, } }); });

Related: See More


Questions / Comments: