Skip to main content
vigneshs53970460
Known Participant
November 3, 2016
Question

Spawn page (Pop up message)

  • November 3, 2016
  • 1 reply
  • 354 views

Hi Guys,

I am having a checkbox in the template page (Spawn page).

When I click that checkbox the following pop-up should show "Thank you for accepting the order".

I tried some code which is given below.

//Code

function roACx() {

var a = this.pageNum;

var b = "AccOrd" //(this is the template name)

var dot = "." //(the field name is like "ACx.Accept Order.CB")

var c = "ACx" //(this is first four letter which named it for the field)

var f = this.getField(d);

var stem = d;

for (var I = 0; i < this.numFields; I++) {

     if (this.getNthFieldName(i).indexOf(stem).value !="off") {

     app.alert("Thank you for accepting the order." , 0) //("0" refers to the OK button in the pop-up)

}

}

}

This is the code which I used in my form, when I check that checkbox the pop-up is appering (app.alert) is working, in that pop-up message, I am having "OK" button.

When I click "OK" the pop-up is not hiding and I do not know, how to hide the pop-up when "OK" is clicked. Can anyone help with this?.

This topic has been closed for replies.

1 reply

Inspiring
November 3, 2016

There are a number of problems I can see. You don't define or set the "d" variable anywhere, but attempt to it. It not clear what this is supposed to do:

this.getNthFieldName(i).indexOf(stem).value

but it's probably not doing what you expect and always evaluates to true.

Since you have it in a loop that checks all field in the form, the app.alert will be shown for as many times as there are fields.

You're also using both the variable i and I for the loop counter. You need to use one or the other.