MaxT
17 Apr 2007, 6:46 AM
Hello.
I have a question about using the maxLength property with ComboBoxes in a Form. See the code extract below for the combo box I have created in a Form Column.
I have set maxLength=2 for the comboBox. I would expect this to limit users to entering a maximum of 2 characters, just like the HTML "maxlength" property for an input element of type text. If I examine the generated HTML there is not a "maxlength" property present for the relevant input element.
Question: is this the correct behaviour for the ComboBox, or should it be preventing users from entering more than two characters?
Thanks to anyone who can answer this.
Max
f.column(
{width: "auto", labelSeparator: ""},
new Ext.form.ComboBox(
{
fieldLabel: "hr",
name: "from-hour",
mode: "local",
store: new Ext.data.SimpleStore({fields: ["hour"],data : HOURS}),
displayField: "hour",
allowBlank: false,
forceSelection: true,
maxLength: 2,
vtype: "h24",
validation: validate_hour24,
typeAhead: true,
triggerAction: "all",
emptyText: "",
selectOnFocus: true,
width: 50,
listWidth: 50
}
)
);
I have a question about using the maxLength property with ComboBoxes in a Form. See the code extract below for the combo box I have created in a Form Column.
I have set maxLength=2 for the comboBox. I would expect this to limit users to entering a maximum of 2 characters, just like the HTML "maxlength" property for an input element of type text. If I examine the generated HTML there is not a "maxlength" property present for the relevant input element.
Question: is this the correct behaviour for the ComboBox, or should it be preventing users from entering more than two characters?
Thanks to anyone who can answer this.
Max
f.column(
{width: "auto", labelSeparator: ""},
new Ext.form.ComboBox(
{
fieldLabel: "hr",
name: "from-hour",
mode: "local",
store: new Ext.data.SimpleStore({fields: ["hour"],data : HOURS}),
displayField: "hour",
allowBlank: false,
forceSelection: true,
maxLength: 2,
vtype: "h24",
validation: validate_hour24,
typeAhead: true,
triggerAction: "all",
emptyText: "",
selectOnFocus: true,
width: 50,
listWidth: 50
}
)
);