Bill, The challange here is that javascript runs on the client and tcf methods run on the server. There are a couple of ways to get it to work though. If you have frames or iFrames in your app, you can have a 1px frame hidden on the page and modify your onClick handler to load that frame with a url to do the database update on the server. Like: frame.location='some.taf?someParam=value&<@userReferenceArgument>'; The taf file can then call the method and do the database work.
If you don't have frames there's another way to do it. (Someone on this list posted it, but I forget who, sorry.) Put a 1x1 px gif of a dot the same color as your background somewhere on the page, and give it a name. <img name="hitme" src="1px.gif" width=1 height=1> Then your onClick handler can refresh the gif by hitting a taf on your server document.hitme.src='some.taf?someParam=value&<@userReferenceArgument>'; In this case your taf file calls your method, does the db update, and returns the 1px gif with an appropriate http header. Either way, whenever your onClick handler fires, your tcf method gets called. Dave Shelley -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Bill Downall Sent: Thursday, January 16, 2003 12:00 PM To: Multiple recipients of list witango-talk Subject: Witango-Talk: javascript to call a method? I would love some help getting started with an efficient way to do the following: User moves selected items from listbox "a" to listbox "b" To do this now, I am using a vascript example contributed by Phil Webb to javascript.internet.com, and it works great. An onclick() event repopulates the two list boxes. I would like to, at the same time, call a tcf method that actually does database inserts to match the screen. Is it possible to use javascript to launch the callmethod? thanks in advance. Bill ________________________________________________________________________ TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED] with unsubscribe witango-talk in the message body ________________________________________________________________________ TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED] with unsubscribe witango-talk in the message body
