diff options
author | Holden Rohrer <hr@hrhr.dev> | 2020-05-16 18:15:51 -0400 |
---|---|---|
committer | Holden Rohrer <hr@hrhr.dev> | 2020-05-16 18:25:55 -0400 |
commit | b0b0d5b8c89df795a7b780265a5c1ed32a7e7359 (patch) | |
tree | 1c3be62bf72445c851b5679a6ee977fc8ea173f4 /www | |
parent | 8f3141a986b7304bafb5de5f77decf22b389ab53 (diff) |
javascript radio button selection persists between reloads
Diffstat (limited to 'www')
-rw-r--r-- | www/index.html | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/www/index.html b/www/index.html index 148cb59..3fbcaf8 100644 --- a/www/index.html +++ b/www/index.html @@ -9,13 +9,16 @@ document.getElementById(id).style.display = ''; curform = id; } + window.addEventListener('load',function(){ + if (document.getElementById('roombutton').checked) switchShow('room'); + }); </script> </head> <body> <h4>Form Type:</h4> <input type="radio" name="form" value="award" onchange="switchShow('award')" checked>Award</input><br> - <input type="radio" name="form" value="room" onchange="switchShow('room')">Room</input><br> + <input type="radio" name="form" id="roombutton" value="room" onchange="switchShow('room')">Room</input><br> <form action="award.pdf" method="get" id="award" class="submit"> Committee: <input type="text" name="committee"/><br> Country: <input type="text" name="country"/><br> |