Skip to main content
Inspiring
March 14, 2022
Answered

Passing value of Variables

  • March 14, 2022
  • 3 replies
  • 1732 views

Hi Coders...

 

I am missing something and hoping one of you can point me in the right direction.

I am working on a form that will generated text boxes and have the following snip of code:

-----

var vLeft = this.getField("txbxLeft#").value;

var vRight = this.getField("txbxRight#").value;

var vBottom = this.getField("txbxBottom#").value;

var vTop = this.getField("txbxTop#").value;

app.alert(vLeft+" "+vRight+" "+vBottom+" "+vTop,3)

this.addField("Text1", "text", 0, [vLeft,vRight,vBottom,vTop]);

----

My objective is to have text fields on the form that have a number supplied by the user. That number will help determine the location of the text box on the page. The app.alert tells me that the value of the txbx has been captured, but the values are not being passed to the addField method.

 

What am I missing?

 

Kindly,

 

Robert

This topic has been closed for replies.
Correct answer Nesa Nurani

Use  vLeft,vTop,vRight,vBottom in that order.

3 replies

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
March 15, 2022

Use  vLeft,vTop,vRight,vBottom in that order.

Inspiring
March 15, 2022

Thank so much Nesa Nurani! That worked....

 

Plain as day and got right by me. Cheers!

try67
Community Expert
Community Expert
March 14, 2022

Can you share the actual file with us?

Inspiring
March 14, 2022

The form has some random fields...

 

The bottom part of the form contains four textboxes and a button below that. It is the button that triggers the action...

try67
Community Expert
Community Expert
March 14, 2022

The coordinates of the rect array are not "left, right, bottom, top", but "bottom left x, bottom left y, top right x, top right y".

Bernd Alheit
Community Expert
Community Expert
March 14, 2022

Any error in the Javascript console? What values does you enter?

Inspiring
March 14, 2022

No errors. The text box is not drawn.

Alert reports the values entered into each text box.

Bernd Alheit
Community Expert
Community Expert
March 15, 2022

Use Tools > Prepare Form

Can you see the field in the list of field names?