Hi all,

Question regarding the use of .load with a checkbox. I have a list of items.
Each item has a checkbox with a unique id. When the customer checks the
checkbox i want to do an ajah request to an external file (like adding an
item to the cart) which then updates the content in a div showing updated
totals. I have that working fine, but it only works on the first check. if I
check another box or uncheck an item the page reloads instead of doing the
get request via ajax. Any ideas?

<script type='text/javascript'>
$(document).ready(function(){ 
        $("[EMAIL PROTECTED]'checkbox']").click(function(){ 
                if ($(this).is(":checked")){
                        $("div#test").load("cartupdate.cgi?action=add&val="
+ this.value);
                } else {
                       
$("div#test").load("cartupdate.cgi?action=remove&val=" + this.value);
                }
        }); 
});
-->
</script>
-- 
View this message in context: 
http://www.nabble.com/checkbox-and-.load-tf3707122s15494.html#a10368208
Sent from the JQuery mailing list archive at Nabble.com.

Reply via email to