$(document).ready(function(){ $('#targets').submit(function() { var error=0; var name = $('#name').val(); if(name == ''){ error = 1; alert('Name cannot be empty'); } var country = $('#country').val(); if(country == '0'){ error = 1; alert('You should select a country.'); } var comment = $('#comment').val(); if(comment == ''){ error = 1; alert('Comment cannot be empty.'); } if(!($('#checkboxid').is(':checked'))) { error = 1 alert("Please Tick the Agree to Terms of Use"); } if(error){ return false; }else{ return true; } }); });
Follow Us On Facebook