>you'd need the onclick to call a function that triggers tha AJAX call. > >I've found JSMX to be a very nice lightweight library for AJAX, and i >think it'd work well for you here (you don't need all the bells and >whistles of a jQuery or YUI or Prototype etc for this specific task). > >http://www.lalabird.com > > >>
I am trying to get this to work (as it seems, indeed, very lightweight--perfect for my one needed function), but I am not having any success. Could you look at this and see what I'm doing wrong (bear and mind that I am a complete noob when it comes to stuff like this...) ----------------test.cfm----------------------------- <script src="engine.js"></script> <script> function createComment(){ param1 = 'commenter='+document.getElementById('commenter').value; param2 = 'text='+document.getElementById('commentText').value; params = param1 + '&' + param2; http( 'POST' , 'xmltest.cfc?method=createComment' , my_response , params ); } function my_response(){ alert("Thanks!"); } </script> <form name="form1"> <input type="text" name="commenter" value="Joel"> <input type="text" name="commentText" value="This is not working!"> <input type="button" name="myButton" onclick="createComment()"> </form> ----------------------xmlTest.cfc------------------------------- <cfcomponent> <cffunction name="createComment" access="remote" returntype="void"> <cfargument name="commenter" type="string" required="yes"> <cfargument name="commentText" type="string" required="no"> <cfset var newComment = ""> <cfquery datasource="xmlTest"> INSERT INTO comments (commenter, text) VALUES ( #arguments.commenter#, #arguments.commentText# ) </cfquery> <cfreturn newComment> </cffunction> </cfcomponent> Whenever I click the button, I continue to get an error message in javascript about "uncaught exception: [Exception... "Not enough arguments" nsresult: "0x80570001 (NS_ERROR_XPC_NOT_ENOUGH_ARGS)" Thanks for your continued help! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Create Web Applications With ColdFusion MX7 & Flex 2. Build powerful, scalable RIAs. Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:284080 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4