Writing JavaScript EventsLast Updated: 9/22/2008 | |
| Sections above here: Home » Development » Javascript | |
|
Sections below here: Topics in this section: |
The first step is to chose the event for which you want to associate Javascript code to. In this case, we are going to make a function that displays a simple alert when the control obtains focus. The first step is to drop a TIWEdit on the form and double-click on the ScriptEvents property. Once the editor is displayed, click on the OnClick event and then enter the following text in the edit box: ![]() Now when you execute this: ![]() and enter the IWEdit1 box, the alert will show up in the browser.
The last step is to call the function from the OnBlur event of the IWEdit control. To do this, choose OnBlur from the ScriptEvents of the control and enter the following code: CheckLength(this) Where "this" represents the actual control in JavaScript. Everything that has been done previously, could also be done at runtime using the controls "HookEvents" method. For more information regarding HookEvents, see the source directory. |
(C) 2002-2009 - Atozed Software Ltd. | |