View Full Version : Hidden form field

24 Dec 2011, 8:36 AM
If a form field is hidden


an exception is thrown:
maxLength is not defined


function f1(out,values,parent,xindex,xcount) {

try { with(values) {

return(maxLength !== undefined)

}} catch(e) {}


24 Dec 2011, 8:59 AM
When do you get the error? Just displaying is fine for me:

Ext.create('Ext.form.Panel', {
renderTo : Ext.getBody(),
width : 400,
height : 400,
title : 'Test',
items : [
xtype : 'hidden', //should use the more standard hiddenfield
name : 'text'

24 Dec 2011, 9:51 AM
Interesting. Your panel worked for me also. It seems to fail when wrapped in a window:

var dlPassChangeWin = Ext.create('Ext.window.Window', {

width: 400,

height: 400,

title: 'Test',

items: [

xtype: 'hidden', //should use the more standard hiddenfield
name: 'text'





24 Dec 2011, 10:01 AM
And you are using 4.1 beta 1? I'm not getting any error using that code.

24 Dec 2011, 10:07 AM
Uhhg. I am. Unfortunately, all my forms are contained in windows and all that have hidden fields are throwing this error. I will try to isolate this outside my application.

24 Dec 2011, 11:11 AM
I have no problem getting this exception outside my application using the code above.

Let me ask you this...
The error is wrapped in a try/catch block. The settings I am using is to break on all exceptions (caught or not).

Are you breaking only on uncaught exceptions or are you just not getting it at all?

24 Dec 2011, 1:37 PM
It's a caught exception when testing the definedness of an optional value. Not a bug.

25 Dec 2011, 6:46 AM
Throwing an exception to test the definedness of an optional value sounds crazy to me - but I guess that is a topic better discussed elseware.

Thanks for the info.