cancel
Showing results for 
Search instead for 
Did you mean: 

Based on dropdown Values

Former Member
0 Kudos

Hi,

In My Adobe Form there is a dropdown field(car Grade) having 12 values and "None" is one value among them.

e.g

Value1

Value2

Value3

.

.

.

None

Also in my form there is a radio button. Based on the selection from dropdown the radio button should be read only or open.

If no value selected i.e blank the radio button shud be read only and also when None is selected from the dropdown it shud be again read only.

What I have done now is this:

-


data.#subform[0].#subform[6].ISR_RadioButtonListGroup.ISR_RadioButtonList::initialize: - (JavaScript, client)

ISR_RadioButtonListGroup.ISR_RadioButtonList.access = "readOnly";

-


data.#subform[0].#subform[6].CarGrade::change: - (JavaScript, client) -


if (CarGrade.selectedIndex.value = 0 | CarGrade.selectedIndex.rawValue = "None" )

{

ISR_RadioButtonListGroup.ISR_RadioButtonList.access = "readOnly";

}

else

{

ISR_RadioButtonListGroup.ISR_RadioButtonList.access = "open";

}

But its not working. Also I tried with CarGrade.rawValue = "None", still not working.

Plz help

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Thanks a lot Madhu, it worked for me.

But one more problem appeared.

BY selecting some value(other than None) from dropdown, radio button are open and after slecting Yes or No

when I again select None from the dropdown, the selected values Yes or No doesn't go away.

For that I did scripting like this:

-


data.#subform[0].#subform[6].CarGrade::change: - (JavaScript, client)

-


if ( selectedvalue == " " || selectedvalue == "None" )

{

ISR_RadioButtonListGroup.ISR_RadioButtonList.access = "readOnly";

if (ISR_RadioButtonListGroup.ISR_RadioButtonList.ISR_RadioButton[0].value = 2 || ISR_RadioButtonListGroup.ISR_RadioButtonList.ISR_RadioButton[0].value = 1)

{

ISR_RadioButtonListGroup.ISR_RadioButtonList.ISR_RadioButton[0].value = 0;

ISR_RadioButtonListGroup.ISR_RadioButtonList.ISR_RadioButton[0].value = 0;

}

}

else

{

ISR_RadioButtonListGroup.ISR_RadioButtonList.access = "open";

}

I tried with also ISR_RadioButtonListGroup.ISR_RadioButtonList.ISR_RadioButton[0].rawValue = 2

but still the earlier selected values doesn't go off.

Plz help

0 Kudos

Hi,

try this

var selectedvalue = this.boundItem(xfa.event.newText);

xfa.host.messageBox("selected value"+selectedvalue);

if ( selectedvalue == " " || selectedvalue == "None" )

{

ISR_RadioButtonListGroup.ISR_RadioButtonList.access = "readOnly";

ISR_RadioButtonListGroup.ISR_RadioButtonList.rawValue = " ";

}

else

{

ISR_RadioButtonListGroup.ISR_RadioButtonList.access = "open";

}

Thanks,

Madhu.

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks a lot Madhu!!!

0 Kudos

Hi,

first for the cargrade dropdownlist goto Object Pallete->binding Tab->Specify Item Values

if it checked then you uncheck it and then

try the below script in the Change Event of cargrade

var selectedvalue = this.boundItem(xfa.event.newText);

xfa.host.messageBox("selected value"+selectedvalue);

if ( selectedvalue == " " || selectedvalue == "None" )

{

ISR_RadioButtonListGroup.ISR_RadioButtonList.access = "readOnly";

}

else

{

ISR_RadioButtonListGroup.ISR_RadioButtonList.access = "open";

}

just to check the value i have used this line

xfa.host.messageBox("selected value"+selectedvalue);

u can remove this after it is running correctly.

Thanks,

Madhu.