Thanks so much for the tips Wizzud. You got me on the right track.

On May 31, 12:44 am, Wizzud <[EMAIL PROTECTED]> wrote:
> Just so I'm straight on this....
>
> In main page:
>   on doc ready,
>     1. load 'invoices' code, with callback{
>       2. load 'paybox' code
>       3. add click() to checkboxes on 'invoices' code
>       }
>
> Then the code for 3 is what you have below, which is roughly
>
> on click {
>   if checked, reload 'paybox' code with 'addpay' and value
>   else, reload 'paybox' code with 'delpay' and value
>
> }
>
> Personally, I would put a class on your checkboxes and use that to find them
> - and even if you don't want to do that there is no need to use the
> substring in the attribute check ([EMAIL PROTECTED]'checkbox']) because it's 
> either a
> checkbox or it's not, so [EMAIL PROTECTED] is sufficient. However, as I said
> I would add a class - eg. boxIncludeInvoice - to each checkbox and use that
> instead.
> Also, you don't have to use jquery where it is simpler not to, for example,
> why test $(this).is(':checked') when a test on this.checked is adequate.
> (I have checkbox click functions working in IE7 that make make a group of
> checkboxes act like radio buttons, simply by testing this.checked).
>
> The main page script might look something like (using snippets provided in
> previous posts)
>
> $(document).ready(function(){
>   function loadPaybox(params){
>     $("div#paytotal").load("payment_total_load.html",(params || {})); // add
> callback if needed
>   }
>   function reloadPaybox(){
>    loadPaybox( (this.checked ? {addpay:'yes', paystr:this.value} :
> {delpay:'yes', paystr:this.value}) );
>   }
>   $("div#payments").load('account_rec_load.html',function(){ // start of
> callback...
>     loadPaybox();
>     $('.boxIncludeInvoice').click(reloadPaybox); // add click to checkboxes
>   }); // ends payments load callback
>
> }); // ends document ready
>
> Lastly, be aware that all the above may be over simplified, in that you may
> want to consider what the user might be doing while paybox is loading - like
> clicking a load more checkboxes. In which case you might want shift the 'add
> clicks to checkboxes' into a callback when loading paybox, and precede the
> loading of the paybox with an unbind('click', reloadPaybox) for the
> checkboxes, thus preventing the user clicking more checkboxes until the
> previous click has done all the processing it needs to.
>
> This may or may not help!
>
>
>
> John W wrote:
>
> > Weird I posted a reply about this earlier this morning and it never
> > went through. Anyway, Wizzud thanks for the tip this worked. One other
> > question related to this same piece. The .load works now in IE7 and
> > FF, but for some reason I cant get IE to fire the click unclick
> > actions on some checkboxes in the page. basically in the page that
> > lists all the invoices that can be paid I have a checkbox next to each
> > one. If the user clicks a check box I reload the paybox with the value
> > to be added and the new total displayed. Again works in FF2 but not
> > IE7.
>
> > checkbox code.
> > <!--
> > $(document).ready(function(){
> >   $("[EMAIL PROTECTED]'checkbox']").click(function(){
> >      if ($(this).is(":checked")){
> >              $("div#paytotal").load("payment_total_load.html?
> > addpay=yes&paystr=" + this.value);
> >      } else {
> >              $("div#paytotal").load("payment_total_load.html?
> > delpay=yes&paystr=" + this.value);
> >      }
> >   });
> > });
>
> > Just to describe the process of whats going on, the main page loaded
> > in the browser is account_rec.html. That page has a div #payments that
> > loads account_rec_load.html (this is the listing of invoices that can
> > be paid).  And inside of account_rec_load.html is a div that loads
> > payment_total_load.html (the paybox showing totals).  Wizzuds tip
> > resolved my issue with the paybox not displaying in IE7. By putting
> > the second load in the callback of the first it resolved the problem.
> > But now I'm stumped as to how to get IE7 to receive the click events
> > from the checkbox. It all works great in FF.
>
> > -->
>
> > On May 29, 5:28 pm, Wizzud <[EMAIL PROTECTED]> wrote:
> >> Have you tried putting the second load into the callback of the first
> >> load?
> >> eg.
> >> $(document).ready(function(){
> >>    $("div#payments").load('account_rec_load.html',function(){
> >>       $("div#paytotal").load("payment_total_load.html");
> >>    });
>
> >> John W wrote:
>
> >> > Ok so I have payment page.  When the page loads I fill in a list of
> >> > payments within a div using .load, and within the page being loaded in
> >> > the div, I have another .load that feeds in a total box. This all
> >> > works great in FF2, but for some reason in IE7 the paybox doesnt not
> >> > display.
>
> >> > So in the main page I load the list page using .load like so and it
> >> > works fine in both IE7 and FF2.
>
> >> > $(document).ready(function(){
> >> >    $("div#payments").load('account_rec_load.html',function(){
> >> >    return false;
> >> >    });
> >> > });
>
> >> > Then in the 'account_rec_load.html' page I have a similiar load
> >> > function that just loads in a totals box using .load as well. This
> >> > works in FF but not IE7. I'm assuming its because the ajax loaded page
> >> > isnt actually being seen as loaded in IE7? Sorry Im not quite the
> >> > javascript guru. Any ideas why IE7 is treating this differently.
>
> >> > $(document).ready(function(){
> >> >    $("div#paytotal").load("payment_total_load.html",function(){
> >> >    return false;
> >> >    });
> >> > });
>
> >> --
> >> View this message in
> >> context:http://www.nabble.com/.load-issue-with-IE7-tf3833063s15494.html#a1086...
> >> Sent from the JQuery mailing list archive at Nabble.com.
>
> --
> View this message in 
> context:http://www.nabble.com/.load-issue-with-IE7-tf3833063s15494.html#a1088...
> Sent from the JQuery mailing list archive at Nabble.com.

Reply via email to