cancel
Showing results for 
Search instead for 
Did you mean: 

Enabling and disabling input filed based on the Dropdown values selection

Former Member
0 Kudos

HI,

I have a requirement with Adobe Interactive forms being called from HCM Forms & Processes. We have a drop-down list and a inputbox.

based on the values selected from the drop-downlist, the input box should be visible and hidden.

If the input value is visible, I got to send some part of the value selected from the drop down to the input field.

i tried to write the following script in the click event of dropdown but the input field is not appearing with any value selection.

if data.Layout.CH1.CHContent.ISR_DDL_1stSelected.rawValue = "00000000" then

data.Layout.CH1.CHContent.ISR_NEW_COST.presence = 'Visible' else

data.Layout.CH1.CHContent.ISR_NEW_COST.presence = "Hidden"

endif

Thanks in Advance,

VR.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Check you are getting the value of Dropdown field in the click event .

xfa.host.messageBox(data.Layout.CH1.CHContent.ISR_DDL_1stSelected.rawValue)

See this thread

Kind Regards,

Mukesh

Former Member
0 Kudos

Hi Mukesh,

Thanks alot for the reply. there was some syntax issues in my script. Am able to enable and disable the input field based on the drop down selection now.

In addition, am passing a value to the enabled input field from the drop down selection. I need to send only a portion of the field .

do we have any function in Java Script to split the text value.

EX : 'HCMTEST|1234' is the value . I would like to split the value at the pipe ('|') and cosider the only1234.

Thanks in Advance,

Venkatesh.

Former Member
0 Kudos

Hi

Try this code in javascript


var sal_prog1 = this.rawValue;

if(sal_prog1 != "" & sal_prog1 != null)
{
var arr = sal_prog1.split("|");
var ch = arr[0];
var num = arr[1];

}

Kind Regards

Mukesh

Former Member
0 Kudos

Hi Mukesh,

THanks alot.

Yes, The Split functionality is working. I have added the code in 'Change' event and for selecting the value from the Drop down, am writing the code in the 'exit'.

In addition to this, I am populating the values to the drop down from the Generic service. The problem is, while running the Process from Portal and check and send button, the fields fetched from the generic service & the dropdown values are getting refreshed. i hope, this is because of the java script.

pls. suggest me if this can be handled .

Thanks &Regards,

Venkatesh.

Former Member
0 Kudos

Hi

Create a flag and check weather the value loaded already by generic services.

Kind Regards

Mukesh

Former Member
0 Kudos

Hi Mukesh,

The issue is resolved after adding the Operation in the method get_operations in the implemented class. The screen is getting refereshed for every event and hence the values are not being carried again for the generic service fields.

i have coded in javascript to pass the Drop-down value to a new inputfield, if the value passed to be is null /blank, am expecting the same ( blank spaces only ). the issue is : 'EMPTY' is being wriiten to that field if there are no values .

Any thoughts on this?

Thanks in Advance,

Venkatesh.

Answers (0)