I have a checkbox which is preselected checkbox and after clicking it. jQuery function is called and display the form action.
<form id="lcform" action="${requestContextPath }/checkout/applyLPDisc.mobi" method="get">
<input type="checkbox" id="lch" name="lch" value="Loyal" checked>Loyalty Discount<br>
</form>
I have requirement to load form action on the basis of pre-selected checkbox and the jQuery event is triggered once the page loads i.e. no need to click the checkbox.
I have requirement to load form action on the basis of pre-selected checkbox and the Jquery event is triggered once the page loads i.e. no need to click the checkbox. jQuery function :
$('#lch').bind('click', function() {
if(this.checked == true){
document.getElementById('lcform').submit();
}
});
I have requirement to load form action on the basis of pre-selected checkbox and the Jquery event is triggered once the page loads i.e. no need to click the checkbox.