cancel
Showing results for 
Search instead for 
Did you mean: 

Hiding fields based on entered value

Former Member
0 Kudos

Hi!

I want to hide two fields based on information user has entered with if script. this is my case:

if (session.findById("wnd[0]/usr/ctxtRF02K-KTOKK").text === "1010" || "1020" || "1030") {

  session.findById("wnd[0]/usr/lblRF02K-EKORG").hide();

  session.findById("wnd[0]/usr/ctxtRF02K-EKORG").hide();

  session.findById("wnd[0]/usr/lblRF02K-LIFNR").hide();

  session.findById("wnd[0]/usr/ctxtRF02K-LIFNR").hide();

};

tried also with else if statement entering field values one by one, But the result of this is that the fields are hidden independently of the value entered in the KTOKK text field.

Any ideas?

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

if (session.findById("wnd[0]/usr/ctxtRF02K-KTOKK").text === "1010" || session.findById("wnd[0]/usr/ctxtRF02K-KTOKK").text ===  "1020" ) {

}

Former Member
0 Kudos

Sushant,

found out that to use this functionality in full I have to add those hidden fields with property .show(); under else statement, otherwise fields stay hidden even other value is entered.

Answers (0)