http://tutorialzine[dot]com/2010/04/[dot][dot][dot]bon-signup-form/
Хочу слегка модифицировать,хочу чтобы по завершения проверки формы вместо перенаправления(как в статье) эти данные вылезали в блоке вверху страницы(AJAX без перезагрузки),как например вылезают блоки с ошибкой
Модифицированный JS CODE:
CODE (javascript):
скопировать код в буфер обмена
скопировать код в буфер обмена
- // Issuing a POST ajax request to submit.php (the action attribute of the form):
- $.post($('#signupForm').attr('action'),$('#signupForm').serialize()+'&fromAjax=1',function(response){
- if(!response.status)
- {
- // Some kind of input error occured
- // Looping through all the input text boxes,
- // and checking whether they produced an error
- $('input[type!=submit]').each(function(){
- var elem = $(this);
- var id = elem.attr('id');
- if(response[id])
- showTooltip(elem,response[id]);
- });
- }
- else {
- $(response.html).hide().insertBefore('#signupForm').slideDown(900);
- $('#body').val('');}
- }