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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Event Handler question

Status
Not open for further replies.

TheDrParker

Programmer
Nov 21, 2001
55
US
I'm trying to capture the value of a Textbox DTC and update a recordset with it when the user is done updating. the problem I'm running into is:

1) Session variables don't seem to work inside the event handler unless it's run on the server
2) If the event handler is set to run on the server then the onblur can't find the functions created in the event handler because that doesn't run server side.
3)If I create a server side function in another script block and call that from the event handler is doesn't recognize the function.

This is what this part of my code looks like.

<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--
function DataTxtBox1_onblur()
{ MainRecordset.fields.setValue(&quot;Field1&quot;, &quot;Hello&quot;);
Session('Test1') = &quot;Got Page to onblur&quot;;
}
//-->
</SCRIPT>

</HEAD>
<BODY LANGUAGE=javascript onblur=&quot;DataTxtBox1_onblur()&quot;>

Thanx
 
Session is a server side object, and the DTC is client side. There inlies your problem. They are not able to communicate directly.

Remote Scripting is the only solution that I know of (there are some FAQ's in the vbScript forum about the subject) that you can use to communicate w/ the server w/o reloading the page. Fairly complicated stuff that I personally have no experience dealing with (as is the case with most folks, it seems)

Short of that, you'll need to submit the data in a form to the server, where the values can be processed.

so:

<input name=myTxtBox onBlur=&quot;document.forms[0].submit();&quot;>

just a for instance, so that when the text box loses focus (assuming the form is recursive -- action pointing to the same page), the page reloads, where you can snap up

request.form(&quot;myTxtBox&quot;)

to do whatever you need to do with the value, and then re-render the page, for instance.

hope that helps! :)
paul
penny1.gif
penny1.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top