PDA

View Full Version : FormPanel render error on Firefox 3 and IE8



Valetudo
11 Sep 2009, 12:12 AM
Hi!

The current code javascript code throw an error in FF and IE8. In Opera and Chrome that code work.

error:

this.body is null @ this.body.addClass(this.bodyCls + '-noheader');

js:



Ext.onReady(function () {
var email = 'email';
var code = 'code';
var fs = new Ext.FormPanel({
labelAlign: 'left',
defaultType: 'textfield',
width: 300,
header: false,
border: false,
items: [{
fieldLabel: 'Email cím',
name: 'email',
xtype: 'textfield',
allowBlank: false,
anchor: '-10',
value: email

},
{
fieldLabel: 'Aktiváló kód',
name: 'code',
xtype: 'textfield',
allowBlank: false,
anchor: '-10',
value: code
}],
buttons: [{
text: 'Aktivál',
handler: aktival
}]
})

fs.render('activationWin');

})

HTML fragment:


<body>
<form name="aspnetForm" method="post" action="../Activation.aspx?lang_id=1" id="aspnetForm">
<div class="leiras_content">
<div id="activationWin">
</div>
</div>
</form>
</body>


Where is the problem?

thx!
Valetudox

Condor
11 Sep 2009, 12:26 AM
I tried your code, but I don't have any problems (in Ext 3.0.0)

Valetudo
11 Sep 2009, 12:30 AM
i use this:

/*!
* Ext JS Library 3.0.0
* Copyright(c) 2006-2009 Ext JS, LLC
* lic[email protected]
* http://www.extjs.com/license
*/

link order:

static_resources/javascript/extjs/jquery-1.3.2.js
static_resources/javascript/extjs/jquery.url.js
static_resources/javascript/extjs/ext-jquery-adapter.js
static_resources/javascript/extjs/ext-base.js
static_resources/javascript/extjs/ext-all-debug.js

Condor
11 Sep 2009, 12:46 AM
I tested your code again with the jquery adapter, but still no error.

ps. Include ext-jquery-adapter.js or ext-base.js, but not both!

Valetudo
11 Sep 2009, 12:46 AM
<body>
<form name="aspnetForm" method="post" action="../Activation.aspx?lang_id=1" id="aspnetForm">
<div class="leiras_content">
<div id="activationWin">
</div>
</div>
</form>
</body>


i think the problem is this. aspx use form :(

how can i solve this?

Condor
11 Sep 2009, 12:50 AM
You can't put a <form> in a <form>.

Either:
1. Use an Ext.Panel with layout:'form' instead of a FormPanel.
or
2. Render to Ext.getBody() instead of activationWin.

Valetudo
11 Sep 2009, 12:52 AM
I tested your code again with the jquery adapter, but still no error.

ps. Include ext-jquery-adapter.js or ext-base.js, but not both!

thx. i tested only with ext-jquery-adapter.js but still has the same error.

Valetudo
11 Sep 2009, 12:53 AM
You can't put a <form> in a <form>.

Either:
1. Use an Ext.Panel with layout:'form' instead of a FormPanel.
or
2. Render to Ext.getBody() instead of activationWin.

Thank you very much!

1. work!

bofinho
1 Dec 2009, 3:36 AM
I tried this solution , but i cant to excute this command....
frm.getForm().isValid()

Thanks
Carlos Bof

Condor
1 Dec 2009, 5:01 AM
Correct, for that you would need to use solution 2.