My jquery code below switches a state dropdownlist out with a state input text box depending on the country that is selected.
It also disables one another depending on which one you select, however I would like to make it not disable the other form field but instead have it clear the contents of "othstate" input box if "usstate" is selected
Is this even possible?
<script>
function locationlist() {
$('#othstate').hide().attr("disabled", "disabled");
$('#country').change(function () {
var val = $(this).val();
if (val == 224) {
$('#usstate').val('').show().removeAttr("disabled");
$('#othstate').hide().attr("disabled", "disabled");
} else {
$('#usstate').val('').hide().attr("disabled", "disabled");
$('#othstate').show().removeAttr("disabled");
}
});
}
</script>