Method Html3():getVar() Professional

Get the values of a HTML form variable.

:getVar( <cVarName> ) --> cValue | aValue | NIL
<cVarName> is the name of a HTML form element.

The method retrieves the value of the HTML form variable as a character string. If more than one value was assigned to one form variable, then an array of character strings is returned. The method returns NIL if no value was assigned.


As an example, the method is frequently used in Web applications based on the standard package DLL when the name of a database file is to be determined. In this case, <cVarName> is the string "WAA_USE".

The name of the dbf file can be specified with following HTML code:

<INPUT TYPE=hidden NAME="WAA_USE" VALUE="customer.dbf"> 

With following PRG code the value can be queried within a WAA form function:

cDbf := oHTML:getVar( "WAA_USE" ) // => "customer.dbf" 
USE (cDbf) 

If the value to be retrieved is of type file then the return value is the name of the file. Use the method :getFile() in order to access the file contents. Note that the encoding of the form must have been specified as "multipart/form-data" then.


If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.