diff --git a/create.php b/create.php index 61b6614..1228fc7 100644 --- a/create.php +++ b/create.php @@ -237,28 +237,29 @@ } function updateColor() { - $('#strength').prop('disabled', false); - $('#modifier').prop('disabled', false); + strength = document.getElementById("carddescription"); + strength.removeAttribute('disabled'); + modifier = document.getElementById("modifier"); + modifier.removeAttribute('disabled'); - if ($('#rolecolor').val() = "transparent" || $('#rolecolor').val() = "black" || $('#rolecolor').val() = "white") { + if ($('#rolecolor').val() === "transparent" || $('#rolecolor').val() === "black" || $('#rolecolor').val() === "white") { - $('#modifier').val() = ""; - $('#modifier').prop('disabled', 'disabled'); + modifier.value = ""; + modifier.setAttribute('disabled', ''); - $('#strength').val() = ""; - $('#strength').prop('disabled', 'disabled'); + strength.value = ""; + strength.setAttribute('disabled', ''); - } else if ($('#rolecolor').val() = "brown" || $('#rolecolor').val() = "grey" || $('#rolecolor').val() = "blue-grey" ) { + } else if ($('#rolecolor').val() === "brown" || $('#rolecolor').val() === "grey" || $('#rolecolor').val() === "blue-grey") { - if ( $('#modifier').val() = "accent") { - $('#modifier').val() = ""; - $('#strength').val() = ""; - } - - } + if ($('#modifier').val() === "accent") { + modifier.value = ""; + strength.value = ""; + } + } - document.getElementById("rolecard").className = "card " + $('#rolecolor').val() +" "+ $('#modifier').val() +"-"+ $('#strength').val() + " " + $('#tcolor').val(); + document.getElementById("rolecard").className = "card " + $('#rolecolor').val() + " " + $('#modifier').val() + "-" + $('#strength').val() + " " + $('#tcolor').val(); }