A way to make html form disappear?
What is the recommended or most efficient way (least code/fastest) to make a html form dissapear from a page once the submit button has been pressed and then put in 开发者_如何学Goits place the output of a .php file?
Use Ajax, with JQuery
http://api.jquery.com/jQuery.ajax/
Create a div for the response (#response_content), and in the callback of the function do something like
$("#form_id").hide();
$("#response_content").html(data);
Use JavaScript and set the form to display:none;
(CSS)
And then add a div layer with your output.
精彩评论