简体   繁体   中英

How do I post a form without the page refreshing in jQuery?

I want to be able to post the following form without the page refreshing in jquery and i need the form to post in information into actions.php

can somebody help me please?

<div id="postbox">
    <form method="post" id="ptowall">
        <input name="post" type="submit" value="Post" />
    </form>
</div>

Thank you.

$("#ptowall").bind("submit", function() { return false; });

$.post("your-form-submit-handler", $("#ptowall").serialize());

您可以将$(“ form”)。serialize()命令与Ajax函数一起使用来与服务器通信。

jQuery Form Plugin的效果非常好,并且可以满足您的需求。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM