firefox 在使用Ext表单赋值时出现security error code 1000错误的问题所在
引用国外论坛网址:http://bytes.com/topic/javascript/answers/510210-formfield-not-updated
最近在做工作组新的官方网站后台的时候第一次使用了Ext。
当选中一条新闻 然后把一条新闻的相关内容添加到表单中时Firebug出现了security error code 1000错误
{
xtype:"textfield",
fieldLabel: "新闻图片",
name:"NewsImage",
inputType:"file",
anchor:"50%"
},
xtype:"textfield",
fieldLabel: "新闻图片",
name:"NewsImage",
inputType:"file",
anchor:"50%"
},
然后我通过搜索国外论坛得出问题所在,我在表单填充的时候将fileupload(Textfield type='file')也硬性赋值,用国外的话说就是:
There is no point in even trying to write to the value of an <input
type="file"field. Allowing such an action would be a serious security
violation in any browser, as it would allow a remote web site to
automate the uploading of any file from the user's computer.
于是乎,去掉name,问题解决
1
{
2
xtype:"textfield",
3
fieldLabel: "新闻图片",
4
inputType:"file",
5
anchor:"50%"
6
}
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
2
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
3
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
4
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
5
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
6
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif)
谨记,给fileupload是一件危险的事