submit 一个form以后怎么得到返回值?

yin19991999 2007-12-24 12:11:36

insert file.html:

function PostForm()
{
//document.all("form1").action = "UploadMethod.asp";
//document.all("form1").enctype="multipart/form-data";
//document.all("form1").method = "post"
document.all("form1").submit();

//这里怎么得到返回值filename???


};


UploadMethod.asp:
response.write(filename);
...全文
19775 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
kenny071218 2011-11-22
  • 打赏
  • 举报
回复
看来只能用ajax了。
yixianggao 2007-12-24
  • 打赏
  • 举报
回复
后台提交要得到返回值,好像只能用ajax了,
否则就要刷新页面!

或者iframe局部刷新!
xiaolei1982 2007-12-24
  • 打赏
  • 举报
回复
Request.ServerVariables("HTTP_REFERER")
yixianggao 2007-12-24
  • 打赏
  • 举报
回复
submit 没有返回值!!!

submit Method

Submits the form.

Syntax

FORM.submit()
Return Value

No return value.

Remarks

The submit method does not invoke the onsubmit event handler. Call the onsubmit event handler directly. When using Microsoft® Internet Explorer 5.5 and later, you can call the fireEvent method with a value of onsubmit in the sEvent parameter.
hztgcl1986 2007-12-24
  • 打赏
  • 举报
回复

AJAX






yin19991999 2007-12-24
  • 打赏
  • 举报
回复

我现在是这样做的,用Iframe.

<button type="button" name="ok" onmousedown="PostFrame();" onmouseup="CloseForm();">Submit</button><br>
不直到有没有更好的做法
yin19991999 2007-12-24
  • 打赏
  • 举报
回复
关于iframe怎么做,给各例子吧
yin19991999 2007-12-24
  • 打赏
  • 举报
回复
function PostForm()
{
//document.all("form1").action = "UploadMethod.asp";
//document.all("form1").enctype="multipart/form-data";
//document.all("form1").method = "post"
document.all("form1").submit();
close();

};
还有个问题。
document.all("form1").submit()发现页面并没有真的提交,因为没有执行到UploadMethod.asp里面的函数,直到 close()后才提交。怎么才能 document.all("form1").submit()就提交阿
rjzou2006 2007-12-24
  • 打赏
  • 举报
回复
建议初学,使用iframe局部刷新!

87,904

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧