Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 396
  • Last Modified:

cf: calling stored proc from onclick

can someone show me the Cold Fusion syntax for calling a stored procedure using the onclick event of a checkbox...I need a field in a table to be updated everytime this checkbox is clicked.
0
stacey14
Asked:
stacey14
1 Solution
 
hartCommented:
u cannot call a procedure onclick !

u'll need to submit ur checkbox values to a page - which inturn will call ur procedure & do the necessary updates.

hope that helps

B'Rgds
Hart
0
 
stacey14Author Commented:
ok..thats fine...would you create a javascript function (that calls another page to process the sp) and call it from the onclick of the checkbox, or could I create a CFscript function to do this?
0
 
PE_CF_DEVCommented:
You will have to make a javascript function to call a new page.

ColdFusion:
Server side -executed before the client ever sees anything.

Javascript:
Client side - executed by the visitors machine the only way it can interact with the the server is with new page requests


with javascript you're best bet is to eathier reload the page or popup a new window and the close it right after opening. If you choose the later of the 2 it will not work all the time due to popup blockers. If you need help with the Jscript let us know. (I would post it but its time to do work hehe)
0
[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

 
stacey14Author Commented:
I would prefer to reload the same page instead of loading a new page...I want it to look like they never left the page they are viewing... thanks...yes javascript code would help emmensely
0
 
shooksmCommented:
Here are a couple sites detailing how to use an IFRAME to perform the remote procedure call without reloading the original page.  IFRAMES are only supported on IE4+ and NS6+ but it gets past the issue with a seperate window getting blocked by a popup blocker:

http://dynarch.com/mishoo/rpc.epl
http://developer.apple.com/internet/javascript/iframe.html
0
 
shooksmCommented:
I object.  My solution with the Remote Procedure Call fits the askers requirements of "I want it to look like they never left the page they are viewing".  This is a common way to pass data between a page and a remote server without reloading the entire page.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now