OpenWGA 7.0 - TMLScript reference

TMLContext "this"
Method :

tmlformbyid(id)

On object TMLContext "this"
Usage Returns a TMLForm object representing the WebTML form of the given ID
Description By this method you can retrieve a specific WebTML form by its ID. If the form was defined by a <tml:form> tag this is the ID of the tag.

Available forms are:
  • All forms that have been defined on the current request, either by <tml:form> or WGA.createForm()
  • A form that was posted to the current request
  • All persistent forms
Parameters id (String):

ID of the form

Return value A TMLForm object
Allowed in script types
  • WebTML pages and normal WebTML actions
Examples In the following example a WebTML defines two forms. Therefor not both forms will be available via this.tmlform:

<tml:form id="formA">
.....
</tml:form>

<tml:form id="formB">
.....
</tml:form>


So if you want to access both forms after they have been defined, you may address them by tmlformByID():

this.tmlformByID("formA").field("x")
this.tmlformByID("formB").field("y")