summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/manual-tests/clear-input-file.html
blob: f1ef360e401a73b65efe81c1c669429e13cd9090 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<script>
function clearWithReset()
{
    document.getElementById("form").reset();
}
function clearBySettingValue()
{
    document.getElementById("file").value = "";
}
function clearBySettingValueToNull()
{
    document.getElementById("file").value = null;
}
function clearBySettingValueToX()
{
    document.getElementById("file").value = "x";
}
</script>
<p>Use this to test the various ways you can clear an input type=file element.</p>
<form id="form">
<p>Choose a file here: <input type="file" id="file"></input></p>
<p>Then press one of these buttons, that should clear the file:
<input type="button" value="clear with reset()" onclick="clearWithReset()">
<input type="button" value="clear by setting value to ''" onclick="clearBySettingValue()"></p>
<p>Or press this button that should clear the file, but won't, due to <a href="http://bugs.webkit.org/show_bug.cgi?id=13448">bug 13448</a>: <input type="button" value="clear by setting value to null" onclick="clearBySettingValueToNull()"></p>
<p>Or press this button to verify we can't set to a non-empty value: <input type="button" value="clear by setting value to 'x'" onclick="clearBySettingValueToX()"></p>
</form>