Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Mirroring values

Avatar

Former Community Member

Two questions from a noob.

1.  I have a form that needs to mirror what the user enters in one text field into a identical text field.  So after the user types info in TextField1, then exits the field, the exact information shows in TextField2.

TextField2.rawvalue = TextField1.rawvalue;

Doesn't work, what did I do wrong?

2.  Same question, but this time a radio button.  User chooses a value on RadioButton1 then RadioButton2 mirrors the input.

Thanks,

Don

1 Accepted Solution

Avatar

Correct answer by
Level 10

Try TextField2.rawValue=this.rawValue; on the exit event.

Also you could use Global Binding - make sure both fields have the same name and change the binding to Global - no scripting needed.

Radio buttons are a little different as you script to the group, not the individual buttons (though I guess you could).

Assuming the second radio button is in a radio button list called "RadioButtonList2" try this on the click/change event of the first radio button list:


if (this.rawValue==1){
RadioButtonList2.rawValue="1";
}

You'll need to double check the values of the radio buttons to make sure they are correct.

Attaching a quick sample - hopefully it won't be queued forever!

View solution in original post

6 Replies

Avatar

Level 6

Hi,

Try to use TextField2.rawValue = TextField1.rawValue; instead of TextField2.rawvalue = TextField1.rawvalue;

BR

Avatar

Former Community Member

Thanks for the reply, unfortunately didn't work.  On exit from the TextField1 I can get this to work:

     TextField2.rawValue = "TEST";

Do I have to convert rawvalue to string or something?

     TextField2.rawValue = str(TextField1.rawValue)

Thanks,

Don

Avatar

Level 6

No, it has to work wthout converting. Could you post youre form?

Avatar

Correct answer by
Level 10

Try TextField2.rawValue=this.rawValue; on the exit event.

Also you could use Global Binding - make sure both fields have the same name and change the binding to Global - no scripting needed.

Radio buttons are a little different as you script to the group, not the individual buttons (though I guess you could).

Assuming the second radio button is in a radio button list called "RadioButtonList2" try this on the click/change event of the first radio button list:


if (this.rawValue==1){
RadioButtonList2.rawValue="1";
}

You'll need to double check the values of the radio buttons to make sure they are correct.

Attaching a quick sample - hopefully it won't be queued forever!

Avatar

Former Community Member

Thanks, worked like a charm.

Two other minor questions.

1.  Anyway to make the cross in the box a different color?

2.  Why can't I tab to a radio group?

Avatar

Level 10

I'm not sure if there's a way to script it, but I found a way to do it in the xml source.

With a checkbox selected go to the xml source tab, the first line of the checkbox code will be highlighted. A few lines down there should be a font tag something like this:

<font typeface="Myriad Pro"/>

You want to make it look like this (this example will make it solid blue):

<font typeface="Myriad Pro">
      <fill>
           <color value="0,0,255"/>
      </fill>
</font>

Once you've got it the way you like it drag the checkbox into your Object Library for re-use.

You should be able to tab to the group without problem, but you can't tab between radio buttons - if you want that functionality then you'll have to script checkboxes. Or use John Brinkman's exclusion group scripts found at http://blogs.adobe.com/formfeed/2008/12/exclusion_groups_v40.html