Closed Bug 100727 Opened 23 years ago Closed 23 years ago

Javascript to modify textarea causes field to go blank/unchangeable

Categories

(Core :: DOM: Editor, defect, P3)

x86
Windows ME
defect

Tracking

()

VERIFIED DUPLICATE of bug 74383
mozilla0.9.7

People

(Reporter: jrhett, Assigned: kinmoz)

References

()

Details

(Whiteboard: [EDITORBASE] CANDIDATE_094, depends on bug 74383, fixed on trunk)

Attachments

(1 file)

From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:0.9.4) Gecko/20010913 BuildID: 2001091303 Using javascript to modify a textarea causes the field to go blank and uneditable/unselectable. The information is still in the field (hitting submit provides the information) but you can't see it on the screen or edit it after the javascript takes effect. Reproducible: Always Steps to Reproduce: 1. Make a textarea with an onChange function that modifies the field. 2. Select the textarea element 3. Type something in the field and then hit tab 4. Watch as the field goes blank and unselectable. Actual Results: The field appeared blank, and I could not select it to edit the data. However the data did submit with the form just fine. Expected Results: The data in the field should remain visible, and I should be able to select and edit the field again. <TEXTAREA NAME="Description" COLS=43 ROWS=6 WRAP="Virtual" onchange="this.value = truncateString( this, 250 ); ">type something here</TEXTAREA> // truncate string to maxlength function truncateString( S, maxlength ) { if( S.value.length <= maxlength ) return S.value ; var i ; var outString = "" ; for( i=0; i<maxlength; i++) { outString += S.value.charAt(i); } alert("Text truncated to " + maxlength + " characters.") ; return outString ; }
FYI I think you could just do this.value=value.substring(0,250)
worksforme, linux build 2001-09-19-08. Windows-only? ccing jkeiser to add this to his form control tests
->editor: core
Assignee: asa → kin
Component: Browser-General → Editor: Core
QA Contact: doronr → sujay
Severity: blocker → major
Priority: -- → P3
Target Milestone: --- → mozilla0.9.5
Attached file Test Case from User (deleted) —
I just attatched Joe's test case, but I can't reproduce this in my 09/21/01 Win32 debug build. Joe, can you try this with a recent build?
Marking WFM since I can't reproduce this. jrhett please reopen if you still see the problem in a recent build.
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → WORKSFORME
verified. reopen if you still see this.
Status: RESOLVED → VERIFIED
Appears to be resolved in 0.9.5. Thanks!
Status: VERIFIED → CLOSED
I agreed with the assessment that this appeared fixed, but over the last few weeks I've started seeing the problem again. It's no longer 100% reproducable, but it still happens far too much. The longer the browser is up and working, the more likely this problem is to occur -- so we've got a state issue here.
Status: CLOSED → UNCONFIRMED
Resolution: WORKSFORME → ---
Joe, are you seeing this problem again in nightly TRUNK builds? I'm wondering if this is related to bug 97674, which is fixed on the trunk, but isn't fixed 0.9.5 builds. When the text disappears, is it just invisible until you hilite/select the text where it should be via the mouse or Ctrl-A? Or does it come back if you obscure the textarea with another window and then expose it again?
Target Milestone: mozilla0.9.5 → mozilla0.9.7
Blocks: 108120
WFM Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.5+) Gecko/20011107
This WFM on Linux 2001110808 (though all cases reported have been on Windows). Joe, can you try a recent build? There have been a recent changes to textarea and modification of value, though nothing *specifically* to resolve this.
Status: UNCONFIRMED → ASSIGNED
Depends on: 74383
Ever confirmed: true
Whiteboard: EDITORBASE
Fix for bug 74383 checked into trunk: mozilla/layout/xul/base/src/nsBoxToBlockAdaptor.cpp revision 1.33 I'm leaving this open till I can land this on the 0.9.4 branch.
Keywords: vtrunk
Whiteboard: EDITORBASE → [EDITORBASE] CANDIDATE_094, depends on bug 74383, fixed on trunk
*** This bug has been marked as a duplicate of 74383 ***
Status: ASSIGNED → RESOLVED
Closed: 23 years ago23 years ago
Resolution: --- → DUPLICATE
v
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: