Never require JavaScript for basic features like HTML forms.
First, write basic functioning HTML.
<form action="" method="get">
<input name="foo" type="text" size="24" placeholder="Type something" />
<input type="submit" value="submit" />
</form>
After the basic HTML is working, add whatever unnecessary enhancements are desired. Use JavaScript code that, when it fails to run on clients that don't want/need it, won't break the underlying functionality.
<script language="javascript">
var form = document.getElementsByTagName('form')[0];
.onsubmit =
formfunction() {
showUnnecessarySpinner();
return true;
;
}</script>
Try submitting this form with JavaScript either enabled or disabled. Note that it works in both cases.