我想做的是制作一个隐藏的表单,我可以使用form.submit提交。我不能使用Ext.Ajax.request,因为我也在上传文件。
我有什么:
function uploadRequest(){
var hiddenTextField = new Ext.form.TextField({
id: 'hiddenTextField'
});
var gridForm = new Ext.FormPanel({
id: 'hiddenForm',
fileUpload: true,
items: [hiddenTextField]
});
hiddenTextField.setValue('Test Value');
var form = Ext.getCmp('hiddenForm').getForm();
form.load(); // I want this to load hiddentextfield into the form?
form.submit({
url: '/main/grabValue',
waitMsg: 'Uploading...'
});
}
如果不是我添加的form.load(),这是有效的:
var win = new Ext.Window({
height: 450,
width: 450,
closable: true,
items: [gridForm]
});
//I need something like a form.render that doesn't actually render here.
//hack that renders the form but also makes and shows a completely unnecessary form.
win.show();
如何在不渲染表单的情况下使用表单的内置提交功能?
答案 0 :(得分:1)
你能放置它top:-9999px;left:-9999px;
吗?许多网站将隐藏的表单字段放在这样的地方以测试垃圾邮件机器人