The violin doesn't work. No response to the button.
-
Html:
<input type="text" placeholder="Имя" id="name" name="name"></br> <input type="text" placeholder="E-mail" id="email" name="email"></br> <input type="text" placeholder="Тема сообщения" id="subject" name="subject"></br> <textarea name="message" id="message"></textarea></br> <input type="button" name="done" id="done" value="Отправить">
Js:
$(document).ready(function(){ $("#done").click(function({ var name= $("#name").val(); var email= $("#email").val(); var subject= $("#subject").val(); var message= $("#message").val(); var fail=""; if(name.length<3) fail="Имя не меньше трех символов"; else if(email.split('@').length-1==0||email.split('.').length-1==0) fail="Вы ввели некорректный email"; else if(subject.length<5) fail="Тема сообщения не менее 5 символов"; else if(message.length<20) fail="Сообщение не менее 20 символов"; if(fail!=""){ $('#messageShow').html(fail+"<div class='clear'><br></div>"); $('#messageShow').show(); return false; } $.ajax({ url:'/ajax/feedback.php', type:'POST', cache: false, data:{'name':name,'email':email,'subject':subject,'message':message}, dataType:'html', success: function(data){ $('#messageShow').html(data+"<div class='clear'><br></div>"); $('#messageShow').show(); }
});
});
});
-
You have a seal in your code. There is no closure in this place:
$("#done").click(function({
Must be like this:
$("#done").click(function(){