Hi Equand,

THanks for the reply.  I was testing in Firefox 2, but I created a
plain example (Im reworking old legacy code) and I think the problem
is with the page html.  In a plain demo I dont get the refresh issue.

Simple example

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml";>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<script type="text/javascript" src="jquery-1.1.2.pack.js"></script>
<script type='text/javascript'>
<!-- adds checks item values in a delimited list to field ostr
$(document).ready(function(){
        $("[EMAIL PROTECTED]'checkbox']").click(function(){
                if ($(this).is(":checked")){
                        $("div#test").load("total.html?
action=add&val=" + this.value);
                } else {
                        $("div#test").load("total.html?
action=add&val=" + this.value);
                }
        });
});
-->
</script>
</head>
<body>
<div id="test"></div>
<form name="get-num" action="" method="get">
<table width="250" border="0" cellpadding="5" cellspacing="0">
 <tr>
  <td>1</td>
  <td>5.00</td>
  <td><input name="check1" type="checkbox" value="5.00|1"> - Add to
pay</td>
 </tr>
 <tr>
  <td>2</td>
  <td>20.00</td>
  <td><input name="check2" type="checkbox" value="20.00|2"> - Add to
pay</td>
 </tr>
 <tr>
  <td>3</td>
  <td>6.00CR</td>
  <td><input name="check3" type="checkbox" value="-6.00|3"> - Add to
pay</td>
 </tr>
         <tr>
  <td>4</td>
  <td>12.00</td>
  <td><input name="check3" type="checkbox" value="12.00|3"> - Add to
pay</td>
 </tr>
         <tr>
  <td>5</td>
  <td>5.00</td>
  <td><input name="check3" type="checkbox" value="5.00|3"> - Add to
pay</td>
 </tr>
         <tr>
  <td>6</td>
  <td>89.00</td>
  <td><input name="check3" type="checkbox" value="89.00|3"> - Add to
pay</td>
 </tr>
</table>
<p>
 <input type="submit" name="Submit" value="Submit" />
</p>
</form>
</body>
</html>


and the external total.html was just something like:
<strong>Current Payment Total:</strong>


On May 7, 8:19 pm, Equand <[EMAIL PROTECTED]> wrote:
> what browser u have? did you check in the error console of firefox?
>
> On May 8, 3:09 am, John W <[EMAIL PROTECTED]> wrote:
>
>
>
> > 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.- Hide quoted text -
>
> - Show quoted text -

Reply via email to