mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Implements basic form resetting
What can this do? Reset `<input type=text>` fields back to their default value through a call to a form's reset method. That's all for now! Fixes compile error after rebase
This commit is contained in:
parent
f932a6947a
commit
f0ce2af89c
3 changed files with 96 additions and 1 deletions
23
tests/html/form_reset_handsfree.html
Normal file
23
tests/html/form_reset_handsfree.html
Normal file
|
@ -0,0 +1,23 @@
|
|||
<html>
|
||||
<head></head>
|
||||
<body>
|
||||
<!-- Run with nc -l 8000 -->
|
||||
<form action="http://localhost:8000" method=get id="foo">
|
||||
<input name=bar type=checkbox checked>
|
||||
<input name=baz value="baz1" type=radio checked>
|
||||
<input name=baz value="baz2" type=radio>
|
||||
<input type=text id=hi name=bye value="hi!">
|
||||
<input type=text id=aloha name=empty value="">
|
||||
<input type=text id=welcome name=reallyempty>
|
||||
<script>
|
||||
// setTimeout because https://github.com/servo/servo/issues/3628
|
||||
setTimeout(function(){
|
||||
document.getElementById("hi").value=("bloop");
|
||||
document.getElementById("aloha").value=("bloop");
|
||||
document.getElementById("welcome").value=("bloop");
|
||||
setTimeout(function(){document.getElementById("foo").reset()},2000);
|
||||
},2000)
|
||||
</script>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue