Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $("#register-form").submit(function(){
- var isFormValid = true;
- $(".required input").each(function(){
- if ($.trim($(this).val()).length == 0){
- $(this).addClass("highlight");
- isFormValid = false;
- }
- else{
- $(this).removeClass("highlight");
- }
- });
- if (!isFormValid) alert("Please fill in all the required fields (indicated by *)");
- return isFormValid;
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement