I'm trying to disable the price input field when the checkbox is ticked and remove any text. I don't know what I'm doing wrong here..
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript">
$('#confP').change(function(){
if ($('#confP').is(':checked') == true){
$('#price').val('').prop('disabled', true);
console.log('checked');
} else {
$('#price').prop('disabled', false);
console.log('unchecked');
}
});
</script>
<input type="checkbox" id="confP" name="confP" value="productType"?>Configurable Product?
Price <input type="text" id="price" name="price"/>