HTML FORM表单中Input标签的一个问题

chenbug 2003-04-04 04:56:33
如下代码
<script language=javascript>
function changeVal()
{
document.upForm.te.value = "c:/12.xml";

//此处弹出的对话框是空值
alert(document.upForm.te.value);
}
</script>

<body onload="changeVal()">
<form name="upForm" method="post" action="up2.jsp"enctype="multipart/form-data" >
<input type=file name="te">
</form>
</body>

我发现Form表单中的te标签(type类型为File)无法赋值,在changeVal函数中赋值了,但alert时,仍然是空值,真的有点晕,如果想赋值,该如何写javascript脚本代码
...全文
89 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
bitisfox 2003-05-31
  • 打赏
  • 举报
回复
value Property
--------------------------------------------------------------------------------
Retrieves the file name of the INPUT control object after the text is set by user input.

Syntax

HTML N/A
Scripting [ sValue = ] INPUT type=file.value

Possible Values

sValue String that receives the file name value of an INPUT type=file control object.

The property is read-only. The property has no default value.

Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see Dynamic Properties.

Applies To

INPUT type=file

已经说明了是只读的了。

3,055

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC HTML/XML
社区管理员
  • HTML/XML社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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