PDA

View Full Version : Firefox,Submit bugs


hushanjun
04-24-2007, 01:22 PM
while i create a form like next code:

var form = new Ext.form.Form({id:'cron',
action:'action',
labelAlign: 'right',
labelWidth: 75});
form.column({width:570,labelWidth:100, labelAlign: 'left',clear:true});
form.fieldset({legend:' ',width:550});
form.column(
{width:290, labelWidth:93},
new Ext.form.TextField({
fieldLabel: 'name',
name: 'name',
width:170,
allowBlank:false
})
);
form.addButton({text:'ok'},function(){form.submit( );});

when i click the button 'ok',firebug report a error,i found it raise by the code from the method 'setForm' of the class YAHOO.util.Connect,i traced,and found that the code in line 748:
// Iterate over the form elements collection to construct the
// label-value pairs.
for (var i=0; i<oForm.elements.length; i++)

because the firefox don't support the 'elements' properties , how can resolve it?

jack.slocum
04-24-2007, 09:32 PM
I would ask this question on the YUI mailing list. I am not sure what/why they are doing in setForm.

hushanjun
04-25-2007, 11:05 AM
sorry, i found the reason when i check the html generated by the code
var form = new Ext.form.Form({id:'cron',
action:'action',
labelAlign: 'right',
labelWidth: 75});

i set a id in the config of the form,so the html generated by the code has two html element

<form id="cron" class="x-form" method="post">
<div id="cron" class="x-form-ct x-form-label-right">


so when submit the form ,in the code
Ext.lib.Ajax.formRequest(
this.form.el.dom,
this.getUrl(!isPost),
this.createCallback(),
isPost ? this.getParams() : null, this.form.fileUpload, Ext.SSL_SECURE_URL);
this.form.el.dom get the element is div,not the form,i think its a bug of ext,isn't it? :)

jack.slocum
04-26-2007, 03:23 PM
Yes, that has been fixed in SVN and will be in the next release.