Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Call Store Procedure via JavaScipt

Status
Not open for further replies.

lordsmusicalbox

Programmer
Dec 13, 2006
8
0
0
US
Programmers,

I am updating a Coldfusion Application in basic terms facilitates the following:

1. User enters part number. When the OnBlur Event fires, the part number is queried to display the description. This is done by loading an iframe with a Coldfusion page.

2. Based on the part number id, I query the database to retrieve the part's UOM. (I also use a hidden iframe element to load Coldfusion page that has a query to retrieve UOM.)

On #2, I tried to mimick what a previous programmer developed by using another iframe, which I will add works decently. However, it is slow on the upload. I know this has to do with addition of the iframe element.

The solution I need is this:
I need to eliminate the additional iframe and have a Stored Procedure call via JavaScript returning the UOM. From here I will use the document.getElementById.innerHTML to store the UOM.

Can I use the Javascript object: stproc.? Can you give me an example of how to set the necessary objects, connection, etc.

Thank you in advance for you expertise

 
Unless you are already aware of AJAX, to be a little more specific, AJAX (CFajax) will give you the ways and means to call a javascript (client-side) function to execute a coldfusion (server-side) function, and in your case this coldfusion function run a query/stored proc, and then return a value or values from that query back to your javascript.
 
okiiyama,

Thank you for taking the time to repond to my question. [medal] I started to look at the links you provided for the AJAX technology, which I will say looks in depth and fascinating. I need to explore AJAX more for future web projects.

With that said, I need to be careful about putting a new technology on a production server without extensive testing. I can't afford any server downtime if you know what I mean. I also need to try the limit how much time it takes to solve this problem. Right now, I have reverted back to original web page.

Do you of another way just using JavaScript, without using AJAX? Could I use the stproc as I have previously mentioned? Any sample code is much appreciated.

Thanks again for your time. May JESUS Bless you...
 
okiiyama,

My technical curiousity looked futher into using AJAX. I might be able to use this methodology after all. I let you know how it turns out.

Thanks again for you time...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top