Server : Apache/2.4.18 (Ubuntu) System : Linux canvaswebdesign 3.13.0-71-generic #114-Ubuntu SMP Tue Dec 1 02:34:22 UTC 2015 x86_64 User : oppastar ( 1041) PHP Version : 7.0.33-0ubuntu0.16.04.15 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, Directory : /var/www/serbaantik.com/public_html/sofapage/assets/vendor/php-email-form/ |
Upload File : |
jQuery(document).ready(function($) { "use strict"; //Contact $('form.php-email-form').submit(function() { var f = $(this).find('.form-group'), ferror = false, emailExp = /^[^\s()<>@,;:\/]+@\w[\w\.-]+\.[a-z]{2,}$/i; f.children('input').each(function() { // run all inputs var i = $(this); // current input var rule = i.attr('data-rule'); if (rule !== undefined) { var ierror = false; // error flag for current input var pos = rule.indexOf(':', 0); if (pos >= 0) { var exp = rule.substr(pos + 1, rule.length); rule = rule.substr(0, pos); } else { rule = rule.substr(pos + 1, rule.length); } switch (rule) { case 'required': if (i.val() === '') { ferror = ierror = true; } break; case 'minlen': if (i.val().length < parseInt(exp)) { ferror = ierror = true; } break; case 'email': if (!emailExp.test(i.val())) { ferror = ierror = true; } break; case 'checked': if (! i.is(':checked')) { ferror = ierror = true; } break; case 'regexp': exp = new RegExp(exp); if (!exp.test(i.val())) { ferror = ierror = true; } break; } i.next('.validate').html((ierror ? (i.attr('data-msg') !== undefined ? i.attr('data-msg') : 'wrong Input') : '')).show('blind'); } }); f.children('textarea').each(function() { // run all inputs var i = $(this); // current input var rule = i.attr('data-rule'); if (rule !== undefined) { var ierror = false; // error flag for current input var pos = rule.indexOf(':', 0); if (pos >= 0) { var exp = rule.substr(pos + 1, rule.length); rule = rule.substr(0, pos); } else { rule = rule.substr(pos + 1, rule.length); } switch (rule) { case 'required': if (i.val() === '') { ferror = ierror = true; } break; case 'minlen': if (i.val().length < parseInt(exp)) { ferror = ierror = true; } break; } i.next('.validate').html((ierror ? (i.attr('data-msg') != undefined ? i.attr('data-msg') : 'wrong Input') : '')).show('blind'); } }); if (ferror) return false; else var str = $(this).serialize(); var this_form = $(this); var action = $(this).attr('action'); if( ! action ) { this_form.find('.loading').slideUp(); this_form.find('.error-message').slideDown().html('The form action property is not set!'); return false; } this_form.find('.sent-message').slideUp(); this_form.find('.error-message').slideUp(); this_form.find('.loading').slideDown(); $.ajax({ type: "POST", url: action, data: str, success: function(msg) { if (msg == 'OK') { this_form.find('.loading').slideUp(); this_form.find('.sent-message').slideDown(); this_form.find("input:not(input[type=submit]), textarea").val(''); } else { this_form.find('.loading').slideUp(); this_form.find('.error-message').slideDown().html(msg); } } }); return false; }); });