ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Web-specific functions / Miscellaneous WEBDEV functions
  • JSProperty handles the control aliases
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
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 is an advanced function, requiring a good knowledge of Javascript.
Example
// Si SAI_Saisie1 est un champ de saisie de la page
// l'instruction suivante affiche le contenu du champ de saisie
Info(JSProperty("_PAGE_." + SAI_Saisie1.Alias, "value"))
// Remarque : On utilise la propriété Alias 
// pour utiliser le nom du champ généré dans la page HTML
// Remplir les champs de saisie numériques SAISIE1, SAISIE2 et SAISIE3 
// avec la  valeur "test"
i is int
FOR i = 1 TO 3
	JSProperty("_PAGE_.SAISIE" + i, "value") = "test"
END
// ATTENTION :
// Pour cet exemple, décochez l'option "compresser le nom des champs (Alias)".
// Cette option se trouve : 
// - dans les options avancées de la page 
// (onglet "Avancé" de la description de la page, 
// option "Optimisation du code HTML personnalisée")
// - dans les options avancées du projet (onglet "Avancé", bouton "Avancé"). 
// Il est ainsi possible de conserver le nom des champs générés 
// dans les pages HTML tels qu'ils ont été définis sous l'éditeur.
// Notez toutefois que les noms des champs sont toujours générés en majuscules.
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. For more details, see Remarks.
<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. For more details, see Remarks.
<Property>: Character string
Property of element to modify.
<New value>: Character string or integer
Value of property for the element to modify.
Remarks

JSProperty handles the control aliases

To build the name of element name, you must know the control alias. This alias corresponds to the control name in the HTML page. To find out this alias:
  • in the code editor, press Shift + F11.
  • use the Alias property.
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.
Component: WDJS.DLL
Minimum version required
  • Version 9
Comments
exemplo jsproperty
https://windevdesenvolvimento.blogspot.com/2021/05/dicas-3343-windev-webdev-mobile.html
https://youtu.be/xfi-BCjwCSw
// Codigo completo no blog
// exemplo jsproperty
// global decalration of page_historico_Edicao_elimina (server)
gscampos is string=glo_campos_form(MyPage..Name)
//------------------------------------
// Load Page_Pagina_Normal (onload browser event)
//FOR EACH STRING sResultado IN gsCampos SEPARATED BY CR
// JSProperty(sResultado,"autocomplete") ="off"
//END
FOR EACH STRING sResultado IN gscampos SEPARATED BY CR
Info(sResultado)
JSProperty(sResultado,"autocomplete")="off"
END
amarildo
16 Jun. 2021

Last update: 03/28/2025

Send a report | Local help