Skip navigation
Deadbuddha
Currently Being Moderated

Can't access textfield value from another page

Aug 17, 2012 7:46 AM

Tags: #field #javascript #scope #access #cant

Hello there, I thought this would be straight forward and simple, but I have hit a wall.

 

I cant seem to access values from another page in a script.

 

I'm trying to set a value of a text field to the value of a text field that is in another page.

On the click event(just for testing) I have:

 

 

eApp.ENB-7-07-CAGAIN_Page_5.a3z_data_AdditionalInfo::click - (JavaScript, client)

 

this.rawValue =  eApp.ENB-7-07-CAGAIN_Page_4.AccountNumber.rawValue;

 

It doesnt get the value.

 

But if i copy create a field on the same page(page 5 here) with the same info, I can access

with this.parent.AccountNumber.rawValue;

 

I can get it to work, by copying the textfields to the page and hiding them, then using their value,

but this seems messy and unnecessary.

 

I just want to be able to access fields on another page, I would have thought it would be as easy as form.page4.accessthisvalue

 

Any help is DEEPLY appreciated, been banging my head for a loong time.

 
Replies
  • Currently Being Moderated
    Aug 17, 2012 4:04 PM   in reply to Deadbuddha

    Hi,

     

    There should not be a problem doing this, you can reference a field anywhere on the form.  Are you getting any script errors?  My first guess would be to rename the field ENB-7-07-CAGAIN_Page_4 so that it does not have the hyphen character in it, it might be trying to subtract 7 from a variable it thinks is called ENB.

     

    Regards

     

    Bruce

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 20, 2012 3:44 PM   in reply to Deadbuddha

    Hi,

     

    Glad I could help,

     

    If you can't get rid of the hyphen from the field name you could try either;

     

    this.rawValue = eApp.resolveNode("ENB-7-07-CAGAIN_Page_4").AccountNumber.rawValue

     

    or

     

    this.rawValue = eApp["ENB-7-07-CAGAIN_Page_4"].AccountNumber.rawValue

     

    You can also change the binding name so the XML still comes out with a hyphen but the field name uses something else.

     

    Regards

     

    Bruce

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points