gvpm Posted March 7, 2007 Share Posted March 7, 2007 hello i have obtained the prototype.js and using it for my comments the problem is im not to good with js. i want this code: <script type="text/javascript"> function send(){ var params = Form.serialize($('commentsForm')); new Ajax.Updater('commentdiv', 'comments.php', {asynchronous:true, parameters:params,}); } </script> to basically when i click my submit buttin a loading image appear...if anyone have already posted this im sorry for the repost i tried searching .... thanks. Quote Link to comment Share on other sites More sharing options...
mainewoods Posted March 8, 2007 Share Posted March 8, 2007 --Turn on the Loading message just before calling Ajax.Updater and then use the 'onComplete' option in the Ajax.Updater to turn it off: function send(){ /* displays the loading message */ document.getElementById("theLoadingMessageID").style.display = ""; var params = Form.serialize($('commentsForm')); new Ajax.Updater('commentdiv', 'comments.php', { onComplete:function(){ /* turn off loading message */ document.getElementById("theLoadingMessageID").style.display = "none"; }, asynchronous:true, parameters:params } ); } http://wiki.script.aculo.us/scriptaculous/show/Ajax.Updater Quote Link to comment Share on other sites More sharing options...
gvpm Posted March 8, 2007 Author Share Posted March 8, 2007 thank you soooooooooooooooooooo much i just learnt something new and im going to read that wiki so i can learn some more i really appreicate it. Quote Link to comment Share on other sites More sharing options...
mainewoods Posted March 8, 2007 Share Posted March 8, 2007 Good luck! 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.