OK. So I made a little work around and managed to toggle visibility of the label as well by hiding complete parents of the input field.
if (selectedValue == âClosed Wonâ){
$("#hideunhide_c").parent().parent().show();
}else{
$("#hideunhide_c").parent().parent().hide();
}
However Iâm still not sure what to do about adding a red star at the end of the label when dynamically making field required.
if(status == âClosed Wonâ){
addToValidate(âEditViewâ,âhideunhide_câ,âvarcharâ,true,â{$mod_strings[âLBL_HIDEUNHIDEâ]}â);
$(â#LBL_HIDEUNHIDEâ).html(â{$mod_strings[âLBL_HIDEUNHIDEâ]}: *â);
}
else{
removeFromValidate(âEditViewâ,âhideunhide_câ);
$(â#LBL_HIDEUNHIDEâ).html(â{$mod_strings[âLBL_HIDEUNHIDEâ]}: ');
}
This doesnât work since #LBL_HIDEUNHIDE cannot be referenced by id (id=""). Referencing by class I havenât managed to make it work yet.
Any tips?