You should add the code this way.
Replace #ID_of_selector in code with the ID of your element.
Might not work if you have a select element which loads its elements with API
$(document).ready(function(){
if ($("#ID_of_selector").val()) {
if (this.value == 2) {
$(this).fields("Tests_1").visible(false); // true to show, false to hide
$(this).fields("Tests_2").visible(true);
} else {
$(this).fields("Tests_1").visible(true);
$(this).fields("Tests_2").visible(false);
}
}
});
Press F12 → Console in browser, check if there is any error in your codes. To debug, press F12 → Source, add a break point to your codes, and press F10 to step through the codes to see why it is not working.Also read: https://hkvforums.com/viewtopic.php?t=49243