I have this structure on the page:
<div class="sapUiVltCell sapuiVltCell">
<div class="row">
<div class="skip-undefined col-1">
<span id="__button0" class="Handler1 sapUiRb sapUiRbInteractive sapUiRbStd sapUiRbSel" tabindex="0" style="width:100%;" aria-labelledby="__button0-label" aria-disabled="false" aria-invalid="false" aria-checked="true" role="radio" data-sap-ui="__button0">
<input id="__button0-RB" type="radio" name="sapUiRbDefaultGroup" tabindex="-1" checked="checked"></input>
<label id="__button0-label" class="sapUiRbNoText" for="__button0-RB"></label>
</span>
</div>
<div class="skip-undefined col-2"> . </div>
<div class="skip-1 col-2">
<input id="__field4" class="Handler1 sapUiTf sapUiTfBack sapUiTfBrd sapUiTfDsbl" value="" style="width: 50%; direction: inherit; text-align: left; background-color: rgb(251, 251, 251); border: 1px solid rgb(219, 219, 219);" aria-autocomplete="none" aria-multiline="false" role="textbox" aria-disabled="true" tabindex="-1" disabled="" data-sap-ui="__field4"></input>
</div>
</div>
</div>
What is gonna happen (in theory, didnt put all the code in here, because its SAPUI5) is, that I klick on a radiobutton and I want my textfield to be enabled and the others disabled again (if one was already enabled), up until now I have this structure for the code:
function selectHandler2() {
$(".Handler2").prop("disabled", false);
$(".Handler2.sapUiTfDsbl").css({"background-color":"rgb(255, 255, 255)",
"border":"1px solid rgb(191, 191, 191)",
"color":"rgb(191, 191, 191)"});
$(".Handler1, .Handler3, .Handler4, .Handler5, .Handler6, .Handler7").prop("disabled", true);
$(".Handler1.sapUiTfDsbl, .Handler3.sapUiTfDsbl, .Handler4.sapUiTfDsbl, .Handler5.sapUiTfDsbl, .Handler6.sapUiTfDsbl, .Handler7.sapUiTfDsbl").css({"background-color":"rgb(251, 251, 251)",
"border":"1px solid rgb(219, 219, 219)"});
};
The classes are generated by SAPUI5. I did each one of these for the 7 different RadioButtons, that activate 7 different textfields.
But now I want to automatize it to only one function selectHandler() instead of 7.
Any ideas would be great.