Сообщение от x-yuri
|
покажи форму
|
<form action="http://www.sitename.ru/forma/kernel.php" method="post">
<div id="information"></div>
<label>Ваше имя:</label><br />
<input type="text" class="imya" name="imya" size="25" maxlength="50" /><br />
<label>Ваш телефон:</label><br />
<input type="text" class="telefon" name="telefon" size="25" maxlength="50" /><br />
<label>Ваш e-mail:</label><br />
<input type="text" class="pochta" name="pochta" size="25" maxlength="80"/><br />
<label>Комментарий</label><br />
<textarea class="message" name="message" cols="30" rows="6"></textarea><br />
<input type="hidden" class="headeritemform" name="headeritemform" value="" />
<input type="hidden" class="catitemform" name="catitemform" value="" />
<input type="hidden" class="priceitemform" name="priceitemform" value="" />
<input type="hidden" class="descriptionitemform" name="descriptionitemform" value="" />
<input type="submit" class="sendform" name="sendform" value="Заказать" />
</form>
ajax:
jQuery('.sendform').click(function(event){
event.preventDefault();
jQuery('#information').html('<img src="http://www.sitename.ru/forma/loader.gif" alt="Подождите..." class="loader2" style="margin: 0 auto; width: 16px; height: 16px;" />').show('slow');;
var zapros = 'headeritemform='+headeritemform_value+'&catitemfo rm='+catitemform_value+'&priceitemform='+priceitem form_value+'&imya='+imya_value+'&telefon='+telefon _value+'&pochta='+pochta_value+'&message='+message _value+'&descriptionitemform='+descriptionitemform _value;
jQuery.ajax({
url: 'http://www.sitename.ru/forma/kernel.php',
type: 'post',
data: zapros,
dataType: 'text',
success: function(data){
jQuery('.loader2').css('display','none');
jQuery('#information').html(data).fadeOut(5000);
},
error: function(data){
alert(data);
}
});
});