I need to uncheck my checkbox when i choose a certain value from my drop down list or when the user does not select any value from the drop down list.
Im using Jquery at the moment.
This is the code that im using right now but it won’t work.
Script
<script src="js/jquery-1.8.3.js"></script>
<script>
function sdp4(str) {
if (
$('#drop1').val()!= ''
|| $('#drop1').val()== "In Process"
|| $('#drop1').val()== "KIV" )
{$('#checkbox1').prop('checked', false);}
else
{$('#checkbox1').prop('checked', true);}
</script>
HTML
<select class="form-dropdown" id="drop1" name="drop1" onchange="sdp4">
<option value=""> </option>
<option value="In Process"> In Process </option>
<option value="KIV"> KIV </option>
<option value="Completed"> Completed </option>
</select>
<input type="checkbox" checked="checked" id="checkbox1" name="checkbox1" />
Assuming the only time you want the check box checked is when completed is selected:
and html:
Here is a FIDDLE