mardi 30 décembre 2014

Pre-Checked Checkbox function

we have on our orderform a function that allows to hide the order-button, when a user does not agree to the Terms and Conditions.


You can see it here: https://secure.purevisionmethod.com/orderforms/launch/step2.php


Right now the page comes up with the checkbox unchecked. We want to set it up, so that it's pre-checked, and that the order-button turns hiding, when a user unchecks the box.


I added checked="checked" to the of the checkbox, but the function controlling the show-hide function doesn't see it.


This is the function:



<script>
$('#agree_box').change(function(){
(this.checked)?$('#offer_fade').css('display','none'):$('#offer_fade').css('display','block');
});
</script>


Can you see why it's not recognizing the preselected checked="checked" within this piece of java?


Thanks!!





Aucun commentaire:

Enregistrer un commentaire