PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • JSProperty is using the aliases of controls
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
JSProperty (Function)
In French: JSPropriété
Allows you to handle specific features on the objects found in the current page. Allows you to:
  • read the Javascript property of an object found in the current page
  • assign a value to the Javascript property of an object found in the current page.
This function is an advanced function: a good knowledge of Javascript is required.
Example
// If EDT_Edit1 is an edit control of the page
// the following statement displays the content of the edit control
Info(JSProperty("_PAGE_." + EDT_Edit1..Alias, "value"))
// Note: We use the ..Alias property
// to use the name of the generated control in the HTML Page
// Fill the numeric edit controls named EDIT1, EDIT2 and EDIT3
// with the "test" value
i is int
FOR i = 1 TO 3
JSProperty("_PAGE_.EDIT" + i, "value") = "test"
END
// CAUTION:
// For this example, uncheck "Compress the name of controls (..Alias)".
// This option is found:
// - in the advanced options of the page
// ("Advanced" tab of the page description,
// "Custom optimization of HTML code" option)
// - in the advanced options of the project ("Advanced" tab, "Advanced" button).
// This allows you to keep the names of the generated controls
// in the HTML pages as they have been defined in the editor.
// You will notice that the names of controls are always generated in uppercase.
Syntax

Retrieving the value of a property for a page element Hide the details

<Result> = JSProperty(<Full Element Name> , <Property>)
<Result>: Character string or integer
Value of property for the element used.
<Full Element Name>: Character string
"Javascript" name of element to use. In most cases, this name starts with "document.". You must use the aliases of controls. See the Notes for more details.
<Property>: Character string
Property of the element to use.

Modifying a property of a page element Hide the details

JSProperty(<Full Element Name>, <Property>) = <New Value>
<Full Element Name>: Character string
"Javascript" name of element to use. In most cases, this name starts with "document.". You must use the aliases of controls. See the Notes for more details.
<Property>: Character string
Property of element to modify.
<New Value>: Character string or integer
Value of property for the element to modify.
Remarks

JSProperty is using the aliases of controls

To build the name of the element, you must know the alias of the control. This alias corresponds to the name of the control in the HTML page. To find out this alias:
  • in the code editor, press SHIFT + F11.
  • by programming, use ..Alias.
Related Examples:
HTMLClass property Unit examples (WEBDEV): HTMLClass property
[ + ] The property ..HTMLClass allows you to read and update the control's HTML attribute "class".
This property lets you select the CSS Style applied on the control.
Components
WEBDEV - Browser code WDJS.DLL
Minimum required version
  • Version 9
Comments
Click [Add] to post a comment