New problem has occurred
I have 2 halves on the form with different Readonly + Select Field Combine
I tried to adapt the code, but it doesn't work
I duplicated the code and adjusted the field IDs
Code: Select all
// WAGEN 1
if (nuFormType() == 'edit') {
typeChanged();
}
var arrTypes = {
Original: ['1W14'], // <---- replace 2, 3 with your object IDs
BBQ: ['1W15'], // <---- replace 4, 5 with your object IDs
Chili: ['1W16'] // <---- replace 6, 7 with your object IDs
}
function enableType(Type, enable) {
for (f in arrTypes[Type]) {
nuEnable(arrTypes[Type][f], enable);
}
}
function enableTypes(o, b, c) {
enableType('Original', o);
enableType('BBQ', b);
enableType('Chili', c);
}
function typeChanged() {
var type = $("#1W11 option:selected").text(); // <---- replace 1 with your select's object ID.
switch (type) {
case "Original":
enableTypes(true, false, false);
break;
case "BBQ":
enableTypes(false, true, false);
break;
case "Chili":
enableTypes(false, false, true);
}
}
// WAGEN 2
if (nuFormType() == 'edit') {
typeChanged();
}
var arrTypes = {
Original: ['1W24'], // <---- replace 2, 3 with your object IDs
BBQ: ['1W25'], // <---- replace 4, 5 with your object IDs
Chili: ['1W26'] // <---- replace 6, 7 with your object IDs
}
function enableType(Type, enable) {
for (f in arrTypes[Type]) {
nuEnable(arrTypes[Type][f], enable);
}
}
function enableTypes(o, b, c) {
enableType('Original', o);
enableType('BBQ', b);
enableType('Chili', c);
}
function typeChanged() {
var type = $("#1W21 option:selected").text(); // <---- replace 1 with your select's object ID.
switch (type) {
case "Original":
enableTypes(true, false, false);
break;
case "BBQ":
enableTypes(false, true, false);
break;
case "Chili":
enableTypes(false, false, true);
}