cancel
Showing results for 
Search instead for 
Did you mean: 

JavaScript for RadiButton

Former Member
0 Kudos

Hi,

I have two radiobutton, One Drop Down List and One List Box.

R1 - Drop Down List

R2- List Box

When I click R1. Drop Down List Should be Invisible.

R2 List Box Should be Invisible.

How to write Java code for this.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Chanshini,

In this case you should use the RadioButtonList. In the object palette --> Binding, set the radioButton values as 1 and 2.

Use following script in the click event of RadioButtonList.

if(this.rawValue == 1){
      DropDownList1.presence = "visible";
      ListBox1.presence = "hidden";
}else if(this.rawValue == 2){
      ListBox1.presence = "visible";
      DropDownList1.presence = "hidden";
}

Hope this will solve the issue.

Thanks & Regards,

Sanoosh

ChrisSolomon
Active Contributor
0 Kudos

Sanoosh's code should do it. Also, make sure you have your settings correct for the initial display of those fields so that they display correctly even before the user clicks either radio button. Lastly, make sure you want to use "hidden" vs "invisible"....hidden just "hides" the element from the form completely whereas "invisible" hides the element but still reserves it "space" in the form. That part really just comes down to how your page design looks.

Former Member
0 Kudos

Hi San,

This Java Script for Adobe LiveCycle Designer.

But, I Created in SFP Tcode.

I need to Visible and Invisible in the Form Builder.

Or I should use the same code for Form Bulider also.

Thanks

Former Member
0 Kudos

Chris, you are absolutely right. I missed out that initial display part. Initial display should be set to visible/hidden as per the requirement.

Thanks & Regards,

Sanoosh

Former Member
0 Kudos

Hi Chanshini,

What do you mean by form builder? Adobe LiveCycle Designer opens in SFP TCode right? And the form layout design is done through Lifecycle Designer.

You can use the script in Lifecycle Designer to get this functionality done.

Please let me know if you have any specific issues.

Thanks & Regards,

Sanoosh

Former Member
0 Kudos

Hi San,

I Use Your JavaScript Code for Offline Scenario. Yeah it's working fine for me.

But my req,I created one form in SFP Tcode(RadioButton, Drop Down and List).And I use this same code, but it is not working.

Thanks

Former Member
0 Kudos

Ok I got it. Please check the following points.

1) In the ABAP driver program used to generate the form, check whether you have set the docParameters, "Fillable = X" & "Dynamic = X"

2) To check the functionality in preview, In the Adobe Lifecycle Designer, Edit --> Form Properties --> Defaults --> Preview, set XDP preview format as 'Acrobat(Dynamic) XML Form'.

Thanks & Regards,

Sanoosh

Former Member
0 Kudos

Thanks San,

This Question has Solved!!!!!

Answers (0)