表单数据发布到同一页面
表单发布到同一页面 您好,我正在使用 jquery,但问题是我无法像这样在提交按钮上加载部分页面!
我有以下表单
<form name="loginform" id="loginform">
<input type="text" name="isname" id="isname">
<select name="hi" id="hi">
<option value=1">Yes</option>
<option value=1">No</option>
</select>
<input type="submit" name="button" id="button" value="Submit">
</form>
现在我关心的是,当我填写数据并单击“提交”按钮时,我
在表单下方声明了以下内容,我希望提交应在下表中加载数据,该表的 id 为“loaddata”并且页面应不刷新
谢谢
,好的,我尝试 AJAXify 表单:
但它仍然没有向我显示任何内容!
id="loaddata"> 的表位于同一页面上,在其中我是否需要包含任何文件,例如我正在处理的位置
form post to same page
Hi i am using jquery but issue is i am unable to load the partial page on submit on button like this!
i have the following form
<form name="loginform" id="loginform">
<input type="text" name="isname" id="isname">
<select name="hi" id="hi">
<option value=1">Yes</option>
<option value=1">No</option>
</select>
<input type="submit" name="button" id="button" value="Submit">
</form>
Now my concern is when i fill the data and click the Submit button, i have the following
declared just under the form and i want the submission should load data in the following table which has id "loaddata" and page should not refresh
Thanks
ok, i tried to AJAXify the form:
but still it showed me nothing!
the table with id="loaddata"> is on the same page and inside it do i need to include any file like where i am doing the processing
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以对表单进行 AJAX 化:
现在,当提交表单时,它将向给定的服务器端操作发送 AJAX 请求,并将结果注入到
#loaddata
容器中。You could AJAXify the form:
Now when the form is submitted it will send an AJAX request to the given server side action and will inject the result into the
#loaddata
container.使用 jquery
ajax
发布表单并使用append
、appendTo
或after
在需要的地方加载结果use jquery
ajax
to post form and load the result where ever desired usingappend
,appendTo
orafter