Well, I'll be....I've just been doing that wrong all along....that works great, TJ.....thanks.....I had some blind luck in that the first time I did it wrong, it seemed to work for some reason.....
Works all of the time now....thanks for your help! sqe On Sep 22, 2:25 pm, "T.J. Crowder" <[EMAIL PROTECTED]> wrote: > Hi, > > That's because you're sending the request for current_solicitations > before you send the request for delete_solicitations (although I > wouldn't rely on the ordering of concurrent XHR requests). This code > in your hidesolicitations method: > > > new Ajax.Updater('nlmsg', url3, {evalScripts:true, > > onSuccess:reset_element(action)}); > > ...*calls* the reset_element function immediately, passing in > 'action', and then assigns the result of the call to the onSuccess > option in that updater. (As the call has no defined return value, the > return value assigned to onSuccess is undefined.) You probably meant > to *define* the onSuccess handler to be a function that calls > reset_element and passes in 'action', rather than actually doing it. > Remember that to call a function, you provide its name followed by > parens: myfunction(). So reset_element(action) *calls* the > reset_element function. If you want to declare (but not execute) a > function that will call reset_element when the onSuccess handler is > triggered, this would do it: > > new Ajax.Updater('nlmsg', url3, > {evalScripts:true, > onSuccess: function() { reset_element(action); } }); > > I haven't thoroughly checked the rest of the code, but that should get > you going. > > HTH, > -- > T.J. Crowder > tj / crowder software / com > > On Sep 22, 9:55 pm, SQE <[EMAIL PROTECTED]> wrote: > > > Good afternoon, > > > I've read a bit about this.....but am struggling nonetheless. In an > > effort to hide records, when a user clicks the "hide" link > > below....the current_solicitation file is still being called before > > the delete_solicitation file. I am watching this happen in Firebug, > > so at least I can explain WHY it isn't working, but I still can't make > > it fire the delete file first. > > > I've also tried onComplete. > > > Any ideas on what I am doing wrong? > > > Thanks! > > > sqe > > > <a href="#" > > onclick="hidesolicitation('[field:'show_id']','[var:'action']');">Hide</ > > a> > > > <script language="JavaScript" type="text/javascript"> > > <!--// > > > function hidesolicitation(showid,action) > > { > > var agree=confirm('Are you sure you wish to hide this > > show?'); > > if (agree) > > { > > var > > url3='/path/delete_solicitation_inline.lasso?showid=' + showid > > + '&-session=msi:' + "[/noprocess][session_id:-name='msi'] > > [noprocess]"; > > new Ajax.Updater('nlmsg', url3, {evalScripts:true, > > onSuccess:reset_element(action)}); > > document.getElementById("title_error").innerHTML = > > '<h3>Show > > Solicitation Hidden!</h3>'; > > > } > > else > > { > > return false ; > > } > > } > > > function reset_element(action) { > > alert (action); > > var url4='/path/current_solicitations.lasso?action='+ > > action +'&- > > session=msi:' + "[/noprocess][session_id:-name='msi'][noprocess]"; > > new Ajax.Updater('contentmain', url4, {evalScripts:true}); > > } > > > //--> > > </script> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---