onPageAction - event of object PmWebDir
The event fires after sending parameters from the HTML document into the PROMOTIC application, for example after the HTML Form is filled in.
|pMe||(Object) Reference to the Promotic object where the event rises.|
|pEvent||(Object) A referrence to object describing detailed information about the specific event.| pEvent.FilePath
Relative path to the file that is requested from the Web browser.
Name of the HTTP method by which the parameters were sent:
"POST" - Sending parameters from the HTML form
"GET" - Sending parameters as a part of the required new page
String that contains values of individual elements from the HTML form. This string has the form, for example "a=13&b=xyz"
, which means that "a"
has the value "13"
has the value "xyz"
By the Pm.HTTPGetFormValue method it is possible to separate individual values from this string (see example).
The event fires after the PmWeb.onNewRequest event and before creating the answer to the client (before loading and modifying the file pEvent.FilePath and before the PmWebDir.onPageModify event).
The event fires only when the client that sends the data, has the access right WebWrite.
An example of sending parameters from the HTML form ("POST" method). The HTML form has, for example, the following content:
<form action="main.htm" method="POST">
<input type="text" name="V1" value="22"/>
<input type="submit" value="Send to the server"/>
When the client enters the value, for example, 33
and it sends the form, then the onPageAction
event fires on the server with the set values:
In the event, for example, this algorithm can be used:
' value "33" is in the sV1 variable ...
An example of sending parameters as a part of the required new page from another HTML page ("GET" method). In any HTML page there can be, for example, the reference:
<A href="main.htm?V1=55">Set V1=55</A>
An example of sending parameters as a part of the required new page directly from the address line of the internet browser ("GET" method). In the internet browser enter, for example: