<form action="index.html" method="POST" class="form-container">
<div class="form-title"><p>Email</p></div>
<input id="formzakaz" autocomplete="off" type="text" name="mail" class="form-field" placeholder="support@toster.ru">
<div class="form-title"><p>Аккаунт ВКонтакте</p></div>
<input id="vk" name="text" class="form-field" ></input>
<div class="submit-container">
<input type="submit" id="formzakazbtn" class="submit-button" value="Отправить">
</div>
</form>
<script>
$(document).ready(function(){
$success_e = false;
$success_t = false;
$('form').on('keyup', '#formzakaz', function(){
var $val = $(this).val(),
r = /^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i;
if (!r.test($val)) {
$(this).addClass('wrong');
$success_e = false;
$('#errmail').fadeIn(750);
return false;
} else {
$(this).removeClass('wrong');
$('#errmail').fadeOut(500);
$success_e = true;
}
});
$('form').on('keyup', '#vk', function(){
var $val = $(this).val(),
n = /(^https?:\/\/)?[a-z0-9~_\-\.]+\.[a-z]{2,9}(\/|:|\?[!-~]*)?$/i;
if (!n.test($val)) {
$(this).addClass('wrongt');
$success_t = false;
$('#errvk').fadeIn(750);
return false;
} else {
$(this).removeClass('wrongt');
$('#errvk').fadeOut(500);
$success_t = true;
}
});
$('form').submit(function(){
if (!$success_t) $('#errvk').fadeIn(750);
if (!$success_e) $('#errmail').fadeIn(750);
if (!$success_t || !$success_e) return false;
});
});
</script>
Ошибка точно не в регулярах!!