[英]How to submit a form in PHP without a refresh or using jQuery or AJAX?
I've Googled around for this one a bit and can't seem to find a simple answer. 我已经在Google上搜索了一下,似乎找不到简单的答案。
I have a form which I submit over to a PHP script for some validation. 我有一个表单,可以提交给PHP脚本进行验证。 What I'm trying to do is submit but without the refresh and without using jQuery or AJAX.
我想做的是提交但没有刷新,也没有使用jQuery或AJAX。
Is there a way to do it in pure HTML or PHP? 有没有办法用纯HTML或PHP做到这一点?
设置表单的target
属性以指向一个iframe
元素。
<form action="iframe.php" target="my-iframe" method="post">
<label for="text">Some text:</label>
<input type="text" name="text" id="text">
<input type="submit" value="post">
</form>
<iframe name="my-iframe" src="iframe.php"></iframe>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.