jquery - PHP FORM reload into load div -


i use jquery function load php content div on indexpage(kinda masterpage) have make email form( use submit button) want reload in div , not whole page?

this menu script(kinda tried sort of things) located on index page.php

      $('.menut').click(function () {        var phpfile = $(this).attr('id') + '.php';        $('#box1').load(phpfile, function () {                  $('#contactform').click(function (e) {                    e.preventdefault();                    var data = $(this).serialize();                    $('#box1').load($(this).attr('action'), data);      }); }); 

this located on form.php page

   <form id="contactform" method="post" action="insch.php"> 

i think should use

$('#contactform').submit(function (e){    e.preventdefault();    $('#box1').load(....)//     return false; }); 

this when form submitted, stop browser doing it's default action, return false, stop other actions if any.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -