var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; }; if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } } { let window = _____WB$wombat$assign$function_____("window"); let self = _____WB$wombat$assign$function_____("self"); let document = _____WB$wombat$assign$function_____("document"); let location = _____WB$wombat$assign$function_____("location"); let top = _____WB$wombat$assign$function_____("top"); let parent = _____WB$wombat$assign$function_____("parent"); let frames = _____WB$wombat$assign$function_____("frames"); let opener = _____WB$wombat$assign$function_____("opener"); (function($){ $(document).ready(function() { $('#submit-form').click(function(e){ e.preventDefault(); var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; var name = $('#form_name').val(), email = $('#form_email').val(), subject = $('#form_subject').val(), message = $('#form_message').val(), data_html, success = $('#success'); if(name == "") $('#form_name').val('Please enter your name.'); if(subject == "") $('#form_subject').val('Please enter your name.'); if(email == ""){ $('#form_email').val('Your email is required.'); }else if(reg.test(email) == false){ $('#form_email').val('Invalid Email Address.'); } if(message == "") $('#form_message').val('Message is required.'); if(message != "" && name != "" && reg.test(email) != false) { data_html = "name=" + name + "&email="+ email + "&message=" + message + "&subject="+ subject; //alert(data_html); $.ajax({ type: 'POST', url: 'contact_form.php', data: data_html, success: function(msg){ if (msg == 'sent'){ success.html('
Message successfully sent!
') ; $('#form_name').val(''); $('#form_email').val(''); $('#form_message').val(''); }else{ success.html('
Message not sent! Please Try Again!
') ; } } }); } return false; }); }); })(jQuery); }