Hello alli am tring to use this code to change the caption of one field conditionaly depends of the value of combobox but it is not working. is there any hints please
i put the code on startup script
$(document).ready(function() {
// Attach change event handler to the combobox
$("#b_name").change(function() {
var selectedValue = $(this).val(); // Get the selected value
// Conditionally change the label based on the selected value
if ((selectedValue === "v1")||(selectedValue === "v2")) {
$("#myLabel").text("New Label Name");
}
});
});
If “#b_name” is your own native tag added by yourself (not an existing field in the table), then the id and the code to get the selected value are correct, otherwise it is wrong. But the id “myLabel” does not look like the id of a field caption. You better check the actual id or CSS selector for the field input and caption by inspecting HTML element in your browser.