I have an array list of two things on a form with a disabled button. I need to use jQuery to check which value is checked, and if a certain one is checked re-enable the submit button.
The model:
private List<String> billTypeOptions;
The controller:
List<String> billTypeList = new ArrayList<String>();
billTypeList.add("Direct Bill");
billTypeList.add("Agency Bill");
model.addAttribute("billTypeList", billTypeList);
ams360Policy.setBillTypeOptions(billTypeList);
The HTML:
<td id="billTypeCell">
<div th:each="billType : ${billTypeList}">
<input class="bto" type="checkbox" th:field="*{ams360Policies[__${stat.index}__].billTypeOptions}" th:value="${billType}" value="off"/>
<label th:text="${billType}" id="billTypeLabel"></label>
</div>
</td>
I've tried this:
if($('.bto').is(":checked"){
$('#send').attr("disabled",false);
}
I've also tried
if ($('.bto').val() == 'Direct Bill")
if ($('.bto').value == 'Direct Bill")