Javascript: Difference between revisions
Appearance
No edit summary |
|||
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{howto|Medium|[[Sam Kapilivsky]]}} | {{howto|Medium| [[Ivo Jansch]] <ivo@achievo.org>, edited by [[Sam Kapilivsky]]}} | ||
This howto demonstrates some Javascript features that are built into ATK. | This howto demonstrates some simple Javascript features that are built into ATK. | ||
== Hiding or showing an attribute or relation depending on the value of another attribute == | == Hiding or showing an attribute or relation depending on the value of another attribute == | ||
Latest revision as of 22:15, 14 November 2008
|
ATK Howto: Javascript
|
This howto demonstrates some simple Javascript features that are built into ATK.
Hiding or showing an attribute or relation depending on the value of another attribute
If you have an attribute that should hide or show depending on the value of another attribute, you can use the following construct:
&$this->add(new atkAttribute('myAttribute',........
$attr = &$this->add(new atkBoolAttribute(........
$attr->addOnChangeHandler("if (newvalue=='no') { hideAttrib('myAttribute'); } else { showAttrib('myAttribute'); }");