Quantcast
Viewing latest article 22
Browse Latest Browse All 86399

Dynamic Form - New table instance loses script functionality.

I have script functions withing two text fields within a table. Whenever the user clicks the add button, a new instance of the table appears. BUT. The text fields lose their scripts?

 

How can I make a new instance of a table that will inherent the original table's scripts? I want it to repeat the row and all of the programming within the row.

 

Here is what I am trying to do.

 

I have "ghost text" in two text fields within a table. It gives the user instructions, but when they click in the text field, the instructions disappear so they can type. But when the user clicks the add button, the 2nd instance of the table does not have the "ghost text" tool tip instructions. It is just blank.

 

Example of my code for one of the text fields. Works like a charm, but it seems this scripting does not make it to the newly added table, only the initial table gets the ghost text instructions.

 

MandatoryForm.page1.B12_rows.B12_row.TableB12.Row1.Table2.Row5.txtOffice::initialize - (JavaScript, client)

 

if (this.isNull)

{

this.fontColor = "153,153,153";

this.font.posture = "italic";

}

 

MandatoryForm.page1.B12_rows.B12_row.TableB12.Row1.Table2.Row5.txtOffice::enter - (JavaScript, client)

 

this.fontColor = "0,0,0";

this.font.posture = "normal";

 

MandatoryForm.page1.B12_rows.B12_row.TableB12.Row1.Table2.Row5.txtOffice::exit - (JavaScript, client)

 

if (this.isNull)

{

this.fontColor = "153,153,153";

this.font.posture = "italic";

MandatoryForm.page1.B12_rows.B12_row.TableB12.Row1.Table2.Row5.txtOffice::prePrint - (JavaScript, client)

 

this.format.picture.value = "";

 

MandatoryForm.page1.B12_rows.B12_row.TableB12.Row1.Table2.Row5.txtOffice::postPrint - (JavaScript, client)

 

this.format.picture.value = "null{'" + this.assist.toolTip.value + "'}";

 

 

MandatoryForm.page1.B12_rows.B12_row.TableB12.Row1.Table2.Row5.txtOffice::ready:form - (JavaScript, client)

 

this.execEvent("exit");

this.format.picture.value = "null{'" + this.assist.toolTip.value + "'}";

 

 

 

 

HERE IS MY ADD BUTTON SCRIPT

 

MandatoryForm.page1.B12_heading.btn_Add_B12::click - (JavaScript, client)

 

this.resolveNode('B12_rows.B12_row._TableB12').addInstance(1);

if (xfa.host.version < 8) {

xfa.form.recalculate(1);

}

Image may be NSFW.
Clik here to view.

Viewing latest article 22
Browse Latest Browse All 86399

Trending Articles