Expand my Community achievements bar.

Dynamically change value of RadioButton group member

Avatar

Former Community Member

Hello,

I am creating dynamic form with livecycle designer and I have a group of radio buttons "Mr.", "Mrs.", "Ms.", "Other". When "Other" button selected, text field appears after the radio buttons group, in which user should enter the "custom" salutation.

The behaviour I want to achieve is that the value user enters in the text field, will become the value of the Radio Button group and I really got lost with this task.

Does anybody know how to do it??

Thanks in Advance,

Peter.

3 Replies

Avatar

Former Community Member

In a RadioButtonList where members are untitled and items in the RadioButtonList are defined as 'Mr.' and 'Other', the following JavaScript can be attached to the exit event of the text field used to capture the new saluation.

form1.page1.subform1.resolveNode("RadioButtonList.#field[1].caption.value.#text").value = this.rawValue;

Steve

Avatar

Former Community Member

Hello Steve,

Thanks for the fast reply.

Unfortunatly It didn't do the job - my test form attached to the message contains radio button list and text field next to them. When you submit the form I want the XML <Other> to contain the text from text box.

Thanks a lot,

Peter.

Avatar

Former Community Member

You might try the following on the exit event of the text field:

Supposing you had an exclgroup called RadioButtonList, and you were wishing to store the value of your text box in a field named 'other'.

RadioButtonList.other.clearItems();
RadioButtonList.other.addItem(this.rawValue, this.rawValue);
RadioButtonList.other.setItemState(0,1);

This will set the value of the radio button 'other' to be the value entered in the text field, and will then 'select' that radio button.

Good luck,

Ryan M. Jacobs

Cardinal Solutions Group

rjacobs@cardinalsolutions.com