dynamically setting maxLength doesn't work for firefox 4 and above

RESOLVED DUPLICATE of bug 1352799

Status

()

Core
DOM: Core & HTML
RESOLVED DUPLICATE of bug 1352799
6 years ago
3 months ago

People

(Reporter: mseema2003, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

6 years ago
User Agent: Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20100101 Firefox/10.0.2
Build ID: 20120215223356

Steps to reproduce:

I am setting attribute maxLength dynamically for a field. First time I am able to set the value but when I open the page again and sets the maxLength it is not getting reflected for that field.


Actual results:

I see in the firebug that maxLength is set to new dynamically calculated value but the html field is not reflecting the same. I  noticed that field textlength still shows older maxLength value because of which field is not considering the new maxLength attribute value.
This works till firefox 3.6 but doesn't work from Firefox 4 and above till Firefox 10.


Expected results:

Dynamically calculated maxLength should be considered for the field in all the firefox versions.
Can you attach a test case to the bug?
(Reporter)

Comment 2

6 years ago
I can't attach end to end working testcase but below is the code snippet:

HTML:

<input type="text" id="${_uid}_choiceListInput" dojoType="dijit.form.ValidationTextBox" required="false"            dojoAttachPoint="choiceListNameInput" trim="true" promptMessage=""              dojoAttachEvent="onKeyUp:onNameChanged,onChange:onNameChanged" style="width: 57%;margin-bottom: 0.5em;" />

Javascript:

var maxLengthValue = 64 - (this._solution.getPrefix().length + 1);
this.choiceListNameInput.attr('maxLength',maxLengthValue);

Everytime I open the page I check for prefix value and calculate the maxLength for choicelistNameInput field.
I can't help you with that small amount of information. My guess is that maxLengthValue is negative which makes maxlength to be ignored.

Would you be okay to send me the testcase to my mozilla email address (mlamouri _ at _ mozilla.com)? It goes without saying: I will not make that test case public.

Comment 4

4 years ago
Hello, looks like we're having the same problem now, Win7 x64 FF 25.0.

mseema2003@gmail.com , did you find the solution?

Thank you.
Flags: needinfo?(mseema2003)
This has already fixed by bug 1352799.  If not fixed, please reopen bug with test case.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 3 months ago
Flags: needinfo?(mseema2003)
Resolution: --- → DUPLICATE
Duplicate of bug: 1352799
You need to log in before you can comment on or make changes to this bug.