Message box not appearing - function not functioning!

Avatar

Avatar

SunsV

Avatar

SunsV

SunsV

29-06-2014

Hi there,

newbie here so be kind please!

I have a table in my form with a remove button for each table row - this works fine, but it occurred to me that it would make more sense to bring up a message box warning the user that they are about to delete a table row. I've tried and tried, but whenever I test or save the file nothing now happens when I click the remove button - no warning window appears and the remove button does not remove the row.

Here's my code:

form1.plan.plansub.plantable.planrow.Remove::click - (JavaScript, both)

var cMsg = "Warning: Clicking YES with remove the current entry from your plan";

cMsg += "\n\nDo you want to continue?";

var nRtn = app.alert({

cMsg,2,2,"Warning"});

if (nRtn == 4)

{

  this.parent.parent._planrow.removeInstance(this.parent.index);

}

xfa.form.recalculate(1);

So, I'm probably doing something really obvious - please help!

Sunil

View Entire Topic

Avatar

Avatar

SunsV

Avatar

SunsV

SunsV

30-06-2014

Hi jnicholas,

I have run the file in acrobat pro and I get the message

SyntaxError: invalid object initializer

4:XFA:form1[0]:plan[0]:plansub[0]:plantable[0]:planrow[0]:Remove[0]:mouseUp

I'm a real beginner here and although I can see the logic in scripting I'm not versed in it... not yet anyway. Any help would be gratefully received.

form1.plan.plansub.plantable.planrow.Remove::mouseUp - (JavaScript, client)

var cMsg = "Warning: Clicking YES with remove the current entry from your plan";

cMsg += "\n\nDo you want to continue?";

var nRtn = app.alert({

cMsg,2,2,"Warning"});

if (nRtn == 4)

{ this.parent.parent._planrow.removeInstance(this.parent.index);

}

xfa.form.recalculate(1);