Closed Bug 179440 Opened 23 years ago Closed 23 years ago

Using DHTML/Javascript to add to a form inside a table causes loss of data allready input on file input boxes

Categories

(Core :: Layout: Form Controls, defect, P3)

x86
All
defect

Tracking

()

RESOLVED FIXED
mozilla1.3beta

People

(Reporter: Rob.Jones, Assigned: john)

References

Details

(Keywords: testcase)

Attachments

(2 files)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2b) Gecko/20021016 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2b) Gecko/20021016 Having created a table that contains form input elements. Using DHTML/Javascript to add more input controls to table/form. The addition of new input controls causes loss of allready input data if that data is a file input control. I attach a file to demo this bug. Reproducible: Always Steps to Reproduce: In attached page.... 1. click 'select new file' 2. click browse and choose a file 3. click 'select new file' Actual Results: previously existing file input box was cleared. Expected Results: kept filename entered in first box.
Attached file testcase
confirming on linux build 2002-11-01-21. jkeiser, I suspect that what's going on here is that the <span> gets another <span> inserted into it which has a <table> inside and we reframe the whole mess (because it's an {ib} situation). Shouldn't the form control persist its state over reframes? Do file controls fail to store state in the content object because of the security restrictions or something?
Assignee: jst → form
Status: UNCONFIRMED → NEW
Component: DOM Other → Layout: Form Controls
Ever confirmed: true
OS: Windows 2000 → All
QA Contact: gerardok → tpreston
Strangely.... IF I make the addrow function add this.... html = ""; html += "<span id='test[" + attachmentCount + "]_i'>"; html += ""; html += "Label"; html += ""; html += "<input type='file' name=''>"; html += ""; html += "</span>"; The new boxes do not clobber the file input box. But if I make the addrow function add this... (added a div) html = "<div>"; html += "<span id='test[" + attachmentCount + "]_i'>"; html += ""; html += "Label"; html += ""; html += "<input type='file' name=''>"; html += ""; html += "</span></div>"; The file input boxes get clobbered. Visually the second function is making the table (which is in the original html code) vertically longer. Just thought I'd mention this observation incase it helps.
Component: Layout: Form Controls → DOM Other
OS: All → Windows 2000
Attached file testcase2
Think my comment about tables being involved is wrong. If I format using divs and spans the same problem is experienced when the addition of code causing the vertical length of the page to increase. I attach a second testcase. Very similar to first but without tables. PS: Every time I have had to add an attachment (before and after recent changes to bugzilla) I have to log in multiple times. I am allready logged in. I choose to add attachment, it asks me to log in again, it then says I did not choose an attachment, I click back and back agian until I see this page and then submit and it finally works.
Noticed one of my earlier comments caused change of component back to DOM Other. Have corrected.
Component: DOM Other → Layout: Form Controls
Yeah, adding the div sticks a block inside an inline, leading to much finagling on the part of the layout engine to deal. See comment 2, sentence 2.
also occurs with linux trunk build 20021109
Keywords: testcase
OS: Windows 2000 → All
It could be some security restriction indeed. I am seeing other problems restoring with textfields in particular; perhaps this is related.
Assignee: form → jkeiser
This should get fixed with bug 152844
Status: NEW → ASSIGNED
Depends on: 152844
Priority: -- → P3
Target Milestone: --- → mozilla1.3beta
Fixed with bug 152844. This was because the file frame was being destroyed along with the table.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: