Injecting JavaScriptLast Updated: 9/16/2008 | |
| Sections above here: Home » Development » Javascript | |
|
Sections below here: Topics in this section: |
Besides using the ScriptEvents property of IntraWeb Controls, there are multiple other possibilities to add JavaScript to your pages. IWForm.JavaScript PropertyThis is the most native method to add JavaScript functions to your pages. Always add JavaScript enclosed with a <script> tag: <script language="Javascript1.2"> Using the above code you can use CheckLength() in other ScriptEvents. IWForm.ExtraHeader PropertyThe IWForm.ExtraHeader property can be used to specify extra content to be inserted in the <HEAD> section of the resulting HTML document. AddToInitProc
procedure TIWForm1.IWAppFormCreate(Sender: TObject); This code will result in alert window appear when browser loads your application. AddValidationAddValidation is an convenient way to add certain validation checks to your page before it gets submitted back to the server. For example to prevent users from submitting a form with blank IWEdits you could write IWForm.IWAppFormRender event handler as below: procedure TIWForm1.IWAppFormRender(Sender: TObject); If the validation condition is true (IWCL.value.length==0), then the page will not submit and the validation message will be shown instead. |
(C) 2002-2009 - Atozed Software Ltd. | |