I have a form for an image upload, when someone completes the form and uploads the image, a div is revealed with a mock loading bar to show the server side stuff is working.
However, what i need to be able to do is only reveal this div IF a ‘terms and conditions’ checkbox has been checked.
Currently if the checkbox is left blank, the div still reveals but a javascript popup tells the user they must check the checkbox, then when they go to upload again the div disappears again.
Any ideas?
my best try so far is:
<script type="text/javascript">
//with thanks to Peter Müller
window.onload = function() {
if (document.uploadform.terms.checked == true)
{
document.getElementById('clicker').onclick = function() {
document.getElementById('toggle').className = (document.getElementById('toggle').className == 'show') ? '' : 'show';
}
}
return true;
}
</script>