Which form event to use on form-open to change text object caption?
hello, have checkbox when selected change caption of text object , 2 text fields, , when deselected revert default caption. when form reopened, want text object's caption 2 text fields' caption set according checkbox being selected or not.
i can 2 text fields using 'form:ready' event. text object has no scripting events use. i'm assuming text object's caption needs changed using event @ form level. believe form's 'docready' event can't make work. i've tried other form events , no 1 works. don't know if i'm not using correct form event or correct scripting, or combination of two.
here's scripting checkbox uses change captions when selected/deselected (this works fine): form1.page1.dgsiteinfo.row2.table1.row1.blnadditionnmsystem::change - (javascript, client)
if (this.rawvalue == 1) //the box checked
{
form1.page1.specs.row3.table1.row2.lblinstalledkw.rawvalue = "added generator capacity (kw)"; //change text object caption form1.page1.specs.row7.table1.row1.numinverterqty.caption.value.resolvenode("#text").valu e = "number of added inverters:"; //change text field caption form1.page1.specs.row7.table1.row1.numtotalinverterkw.caption.value.resolvenode("#text"). value = "total added inverter capacity:" //change text field caption
}
else
{
form1.page1.specs.row3.table1.row2.lblinstalledkw.rawvalue = "installed generator capacity (kw)"; //change text object caption form1.page1.specs.row7.table1.row1.numinverterqty.caption.value.resolvenode("#text").valu e = "number of inverters:"; //change text field caption form1.page1.specs.row7.table1.row1.numtotalinverterkw.caption.value.resolvenode("#text"). value = "total inverter capacity:"; //change text field caption
}
here's scripting 1 of text fields uses when form opens, other text field follows same scripting (this works fine): form1.page1.specs.row7.table1.row1.numinverterqty::ready:form - (javascript, client)
//will ensure label set based on controlling field when form opened
if (dgsiteinfo.row2.table1.row1.blnadditionnmsystem.rawvalue == 1) //if controlling field value checked
{
form1.page1.specs.row7.table1.row1.numinverterqty.caption.value.resolvenode("#text").valu e = "number of added inverters:"; //change field caption
}
//else, field automatically uses default caption
here's scripting i've tried use in forms 'docready' event (and other form events) change text object's caption when form opens (this doesn't work):
form1::docready - (javascript, client)
//will ensure label set based on controlling field when form opened
if (dgsiteinfo.row2.table1.row1.blnadditionnmsystem.rawvalue == 1) //if controlling field value checked
{
form1.page1.specs.row3.table1.row2.lblinstalledkw.rawvalue = "added generator capacity (kw)"; //change text object caption
}
//else, field automatically uses default caption
hi,
these sort of changes preserved when have "preserve scripting changes form when saved" set automatic under file ... form properties ... run-time.
but there times when don't want this, in case should able add javascript code;
this.execevent("change");
in initialise event of blnadditionnmsystem checkbox, perform same logic if checkbox clicked on opening.
regards
bruce
More discussions in LiveCycle Designer
adobe
Comments
Post a Comment