After the js form is submitted, the current page is not refreshed again. After the js form is submitted, the current
How to Implement form submission without refresh the current page
<Form name = 'form1' id = 'form1' action = '/xbcw/cw/xx_xx.action' method = 'post'> <input type = "button" id = "btnSubmit" name = "btnSubmit" value = "save" onclick = "addKp () "class =" Button2 "/> <input type =" button "id =" btnSubmit "name =" btnSubmit "value =" Next "onclick =" doAddCwKpSubmit () "class =" Button2 "/> </form>
After I click Save to submit a FORM, how can I keep the current page unchanged (that is, do not refresh the current page )?
Add an iframe after the FORM
<Iframe id = "rfFrame" name = "rfFrame" src = "about: blank" style = "display: none;"> </iframe>
Click Save submit event to change target to the iframe Name:
JS: document.forms%0%.tar get = "rfFrame ";
JQuery: $ ("# f2"). attr ("target", "rfFrame ");
In this way, the FORM is submitted to save the data, and the page will not jump.
The above is all the content in this article. I hope it will be helpful to you, and I also hope to provide more support for the customer's home!