Changing JavaScript function to work with multiple check boxes to accept terms and conditions -
i have below function works when there 1 product on page:
<script type="text/javascript">// <![cdata[ function confsubmit() { if(!document.getelementbyid("one").checked) { alert("please read , take terms , conditions + warnings in order sign woolly mammoth"); homecoming false; } } // ]]></script>
the above function shows error if check box terms , conditions, has not been checked.
now have multiple products on page own checkbox, problem if set check box next every product shows error unless check box next every product.
can help me edit function can utilize on multiple check boxes 1 box needs checked.
the function called on paypal button. certainly there easier way of doing rather renaming function , changing id every product?
thanks
what can elements classname instead, , give checkboxes mutual css class name. unfortuantely < ie9 not back upwards getelementsbyclassname, suggest using jquery.
function confsubmit() { var checkcount = $('.myclass:checked').length; if(checkcount < 1) { alert('....'); } }
javascript
No comments:
Post a Comment