dlf1987 Posted May 14, 2007 Share Posted May 14, 2007 could sum1 help me add a show hide feature to this function... its a sortable lists from phpriot, how could you make it so that when this function starts its shows a div saying "updating database", and when the function ends it hides the div. function updateOrder() { // turn on update message here var options = { method : 'post', parameters : Sortable.serialize('movies_list'), onComplete : function(request) { // turn off update message here } }; new Ajax.Request('processor.php', options); } i commented where i think ??? the on off should go hope it makes since... thanks! Quote Link to comment Share on other sites More sharing options...
dlf1987 Posted May 15, 2007 Author Share Posted May 15, 2007 bump :'( Quote Link to comment Share on other sites More sharing options...
xenophobia Posted May 17, 2007 Share Posted May 17, 2007 I don't know what type of Ajax library you are using. :-\ It seems like you need a status teller to tell you what is the AJAX status right now. For the most commonly, it should be like this: httpRequest.onreadystatechange = handle; function handle(){ if(httpRequest.readyState == 4){ //done loading. }else{ //loading... } } Quote Link to comment Share on other sites More sharing options...
mainewoods Posted May 18, 2007 Share Posted May 18, 2007 function updateOrder() { // turn on update message here document.getElementById('yourdivID').innerHTML = 'updating...'; var options = { method : 'post', parameters : Sortable.serialize('movies_list'), onComplete : function(request) { // turn off update message here document.getElementById('yourdivID').innerHTML = ''; } }; new Ajax.Request('processor.php', options); } create a div somewhere in your page with id="yourdivID" Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.