[Webkit-unassigned] [Bug 12273] File input value reset in two methods.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jan 14 17:44:31 PST 2007


http://bugs.webkit.org/show_bug.cgi?id=12273





------- Comment #2 from jnicoll at seemysites.net  2007-01-14 17:44 PDT -------
  Just to clarify, the desired behavior is that the value of the fine input
element NOT be cleared when cloned or moved to another parent.

Scenario 1 (works in Safari, not in latest Webkit):

<script type="text/javascript">
        function press_this () {
                var f = document.getElementById('upload_1');
                f.parentNode.removeChild(f);
                document.getElementById('form2').appendChild(f);
        }
</script>

<form action="test.php" method="POST" enctype="multipart/form-data">
        <input type="file" name="upload" id="upload_1"/>
</form>

<input type="button" onclick="press_this();"/>
<form action="test.php" method="POST" id="form2" enctype="multipart/form-data">

</form> 
---------------------------------------
If you select a file, and then press the button, the selected file is gone in
the element.


Scenario 2 (works in neither):

<script type="text/javascript">
        function press_this () {
                var f = document.getElementById('upload_1');
                var f2 = f.cloneNode(true);
                document.getElementById('form2').appendChild(f2);
        }
</script>

<form action="test.php" method="POST" enctype="multipart/form-data">
        <input type="file" name="upload" id="upload_1"/>
</form>

<input type="button" onclick="press_this();"/>
<form action="test.php" method="POST" id="form2" enctype="multipart/form-data">

</form> 
--------------------------------
   The selected value is not copied with cloneNode() in either Safari or the
Webkit nightly.


-- 
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list