I have a form which enables the submit button only when a checkbox is selected. The problem is that people without JavaScript will never be able to enable the submit button. What is the best solution to this problem?
<script src="http://www.lenticularpromo.com/v/vspfiles/js/jquery-1.6.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
$('#accept-box').click(function(){
$('#submitter').attr('disabled',!this.checked);
});
$('#myform').submit(function(){
return $('#accept-box').attr('checked');
});
});
</script>
<form id="myform" class="accept" action="http://dropbox.yousendit.com/KefengXu11610470" method="GET">
<label>I promise to include all required information along with my artwork submission</label>
<input id="accept-box" name="accept" type="checkbox" value="0">
<br>
<input id="submitter" class="submit" type="submit" name="submit" value="Continue to artwork upload" disabled="disabled">
</form>
In my opinion, the best option would be to keep the submit button enabled in the HTML and disable it using the JavaScript. And then validate on the server-side that the checkbox has been checked (you should always validate server-side even if you do client-side, JavaScript can be disabled or bypassed).