$(document).ready(function() { if(!Modernizr.input.placeholder){ $('[placeholder]').focus(function() { var input = $(this); if (input.val() == input.attr('placeholder')) { input.val(''); input.removeClass('placeholder'); } }).blur(function() { var input = $(this); if (input.val() == '' || input.val() == input.attr('placeholder')) { input.addClass('placeholder'); input.val(input.attr('placeholder')); } }).blur(); $('[placeholder]').parents('form').submit(function() { $(this).find('[placeholder]').each(function() { var input = $(this); if (input.val() == input.attr('placeholder')) { input.val(''); } }) }); } $('#start_date').datepicker({ dateFormat: 'MM d, yy', showOtherMonths: true, selectOtherMonths: true }); $('#end_date').datepicker({ dateFormat: 'MM d, yy', showOtherMonths: true, selectOtherMonths: true }); var v = $("#booking_form").validate({ rules: { start_date: { required: true }, end_date: { required: true }, first_name: { required: true }, last_name: { required: true }, phone: { required: true }, email: { required: true, email: true, }, amount_offered: { required: true } }, messages: { }, onkeyup: false, onclick: false, onfocusout: false, errorPlacement: function(error,element) { return true; }, highlight: function(element, errorClass, validClass) { $(element).addClass(errorClass).removeClass(validClass); }, unhighlight: function(element, errorClass, validClass) { $(element).removeClass(errorClass).addClass(validClass); } }); });