Hi folks, now we are going to see, how we can do jquery form validations using jquery and HTML
<html>
<head>
<meta charset="utf-8">
<title>Registration</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
</head>
<body>
<section>
<div class="white_bg" id="white_bg">
<h1>Registration</h1>
<form method="post" id="add_builder" enctype="multipart/form-data" >
<label>Name</label>
<input type="text" name="br_name" class="form-control" /></br></br>
<label>Email Address</label>
<input type="text" name="br_email" class="form-control"/></br></br>
<label>Mobile</label>
<input type="text" name="br_mobile" class="form-control"/></br></br>
<p>Dob: <input type="text" name="nu_datebirth" id="nu_datebirth" /></p>
<label class="nu_label">Age</label>
<input type="text" name="a_ge" id="a_ge" class="nu_field" readonly/></br></br>
<label>Gender</label></br>
<input type="radio" name="gender" value="male"> Male
<input type="radio" name="gender" value="female"> Female</br></br>
<label>City</label></br>
<select name="city">
<option value="">Select City</option>
<option value="Banglore">Banglore</option>
</select></br></br>
<label class="nu_label">Residence / Contact Address</label></br>
<textarea rows="5" cols="10" name="user_addr" id="user_addr" class="msg_fld" ></textarea></br></br>
<label class="nu_label"><input type="checkbox" id="check" name="check" value="check">Click to copy Residence / Contact Address</label></br></br>
<label class="nu_label">Permanent Address</label></br>
<textarea rows="5" cols="10" name="nomi_addr" id="nomi_addr" class="msg_fld" ></textarea><br></br></br>
<label>Upload file </label></br>
<input type="file" name="upload_file" id="upload_file" class="form-control"></br></br>
Terms and Conditions<input type="checkbox" name="terms" value="yes"><br></br></br>
<input type="submit" id="build-sub" name="build-sub" value="SUBMIT" />
</form>
</section>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.8.1/jquery.validate.min.js"></script>
<script>
$(document).ready(function()
{
$("input#check").click(function(){
if ($("input#check").is(':checked'))
{
var a = $("#user_addr").val();
$("#nomi_addr").val($("#user_addr").val());
}
else
{
$("#nomi_addr").val("");
}
});
});
$(function() {
$("#nu_datebirth").datepicker({
onSelect: function(value, ui) {
var today = new Date(),
age = today.getFullYear() - ui.selectedYear;
$('#a_ge').val(age);
},
dateFormat: 'dd-mm-yy',changeMonth: true,changeYear: true,yearRange:"c-100:c+0"
});
});
$('INPUT[type="file"]').change(function () {
var ext = this.value.match(/\.(.+)$/)[1];
switch (ext) {
case 'jpg':
case 'jpeg':
case 'png':
case 'gif':
$('#build-sub').attr('disabled', false);
break;
default:
alert("Only '.jpeg','.jpg','.pdf' formats are allowed.");
this.value = '';
}
});
(function($,W,D)
{
var JQUERY4U = {};
JQUERY4U.UTIL =
{
setupFormValidation: function()
{
//form validation rules
$("#add_builder").validate({
rules: {
br_name: {
required: true,
},
br_mobile: {
required: true,
number: true,
},
br_email: {
required: true,
email: true,
},
gender: {
required: true,
},
terms: {
required: true,
},
city: {
required: true,
},
user_addr: {
required: true,
},
upload_file: {
required: true,
},
dob: {
required: true,
},
},
messages: {
br_name: {
required: "Enter Name",
},
br_mobile: {
required: "Enter Mobile number",
},
br_email: {
required: "Enter Email",
},
gender: {
required: "Select Gender",
},
terms: {
required: "Check Terms and conditions",
},
city: {
required: "Select City",
},
user_addr: {
required: "Enter Address",
},
upload_file: {
required: "Upload file",
},
dob: {
required: "Select dob",
},
},
submitHandler: function(form) {
form.submit();
}
});
}
}
//when the dom has loaded setup form validation rules
$(D).ready(function($) {
JQUERY4U.UTIL.setupFormValidation();
});
})(jQuery, window, document);
</script>
</body>
</html>
Philips Avent Natural Response Baby Feeding Bottle - 125Ml Baby Milk Bottle for Newborns and Up, Bpa Free, 0+ Months (Model SCY900/01)
₹415.00 (as of August 15, 2026 13:17 GMT +05:30 - More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Novel Baby Diaper Pants | XL Size (Extra Large), with Aloe Vera Lotion for rash protection | Pack of 54 Count | Cotton-Soft & Breathable | 360° Comfort Fit, Rash-Free Overnight Diapers for Babies
₹499.00 (as of August 15, 2026 13:17 GMT +05:30 - More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)MN TRADERS Stainless Steel Baby Feeding Bottle, 250ml, BPA Free, with 3 Silicone Nipples and Cleaning Brush, Anti Colic, for Infants 0-2 Years
₹279.00 (as of August 15, 2026 13:17 GMT +05:30 - More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Himalaya Gentle Baby Powder 700g | Keeps baby's skin smooth & dry with natural goodness | Olive Oil, Almond Oil & Yashad Bhasma | No.1 Baby Powder Brand | No.1 Dr. Recommended | 99% NOI
₹340.00 (as of August 15, 2026 13:17 GMT +05:30 - More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)THE LITTLE LOOKERS Feeder Cover Sleeve with Handles | Soft Protective Baby Bottle Holder | Water-Resistant Cover with Anti-Slip Base | Fits Wide-Neck, Compatible with Philips Avent (Blue., 125ml)
₹249.00 (as of August 15, 2026 13:17 GMT +05:30 - More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Pampers Active Baby Tape Style Baby Diapers, Newborn/Extra Small (NB/XS) Size, 72 Count, Adjustable Fit with 5 star skin protection, Up to 5kg Diapers
₹846.00 (as of August 15, 2026 13:17 GMT +05:30 - More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)SHOPPOFOBIX Born Baby Godadi Pack of 3 Combo Set, Soft Cotton godi| Baby Mats | Babys Bed | Crib Sheet | Cartoon Mats Babys Godadi | Bedding Mats Set | Multicolor
₹379.00 (as of August 15, 2026 13:17 GMT +05:30 - More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)MamyPoko Pants Skin Breathe Care | Baby Diapers Medium Size (M) | 62 Count | 7-12Kgs | Half Skin Touch Airy Sheet | 3X Breathable | Derma Tested
₹660.25 (as of August 15, 2026 13:17 GMT +05:30 - More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Novel Baby Diaper Pants | L Size (Large), with Aloe Vera Lotion for rash protection | Pack of 62 Count | Cotton-Soft & Breathable | 360° Comfort Fit, Rash-Free Overnight Diapers for Babies
Now retrieving the price.
(as of August 15, 2026 13:17 GMT +05:30 - More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)