Skip to main content

Posts

Showing posts with the label Ajax

Basic Ajax example

Jquery Ajax and php intro

Ajax call before page submit

Hi there... ok now we want to complete ajax call first and after that the page should submit then write your code like this one on your onclick function :: try to take it as image or normal link .avoid to use submit button < a href="javascript:void(0);" onclick = "javascript:return name_of_function()" > Now in your function use jquery or normal ajax... function function_name() { var html = $.ajax({ type: "GET", url: "ajax_main_sectors.php", data: "sec="+sec_id, async: false }).responseText; Write this line if you want to replace the content in appropriate id.... document.getElementById("name of your id").innerHTML=html; //now.... submit your form $('#id of your form').submit(); OR // in normal way document.nameofyourform.submit(); }