If you use a normal textbox, you simply add the onblur attribute:
<input type=text name=txtFred onblur="txtFred_onblur();">
But if you have a (server-side) textbox DTC, then you have to 'advise' the DTC to get it to respond to certain events:
txtFred.advise "onblur", "dummy()"
If I had a server-side function/sub called dummy(), then it would be called every time the txtFred textbox DTC lost its focus - not so helpful!
However, we can trap this server-event on the client, and prevent the server round-trip. You do this in the thisPage_onbeforeserverevent function (please add a PageObject DTC to you page first). The details of this were shown in my previous response.
Note: The 'advise' method of a DTC allows you to add ANY event signature to a form control. When the DTC generates the HTML for the control at runtime, it adds the 'advise' items to the HTML tag:
<INPUT type="text" id="txtFred" name="txtFred" size=3 maxLength=7 value="0" class="clsTextBox"
onblur="thisPage._fireEvent('txtFred','onblur'); return false;">
The _fireEvent bit causes a few things to occur, including the calling of the onbeforeserverevent - where you can call your routines.
If this DTC method seems horrid, well it is! However, it is really quite easy to modify the DTC code to make things much easier. Just edit the _ScriptLibrary\TEXTBOX.ASP and add a new property, called onblur, and in the display routine (near the bottom) output the onblur attribute if the onblur property is not blank. I can give you the full details if you wish.
(Content Management)