Expand my Community achievements bar.

Binding Text Field and being able to alter text field further down field without altering original

Avatar

Former Community Member

Is there a way to bind two text fields

so that the information in the first imput field can be pushed forward to the second field and then the second field can be modified without modifiying the original field?

Ex:

F.1 P.1 Patient Range of Motion =  Input 50 Degrees

then

F.1.P.2 Patient Range of Motion = (starts as 50) and then can be altered to 100 degrees without altering F.1P.1 Patient Range of Motion = (50 degrees)?

3 Replies

Avatar

Level 10

You can place the following code in the exit event of the First Text Field to populate the Second Text Field.

TextField1 Exit event and Java Script..

TextField2.rawValue = TextField1.rawValue..

But every time you change some thing in TextField1,  TextField2 will get a new value assigned..If you want only to populate TextField2 when it is empty, then alter the code a little..

TextField1 Exit event and Java Script..

     if(TextField2.rawValue != null)

          TextField2.rawValue = TextField1.rawValue..

    

Thanks

Srini

Avatar

Former Community Member

I'm sorry I tried pluggin your Java Script into just a very simple example and it did not work...

Can you be specific with the annotation is this correct:

if(TextField2.rawValue !=  null)        

TextField2.rawValue = TextField1.rawValue

do I need brackets anywhere or to end with a semi colon please excuse my ignorance.

Thanks

Avatar

Level 10

There was a mistake in my code..I need to populate data only when the TextField2 is null...

if(TextField2.rawValue ==  null)       

TextField2.rawValue = TextField1.rawValue

Here is the sample.

https://acrobat.com/#d=Er8lcsah-blzs2DzDdzqlQ

Thanks

Srini