in my Spring web Flow, while click on Confirm button it should highlight the checkbox if it
is uncheck and form should not be submitted. if it is checked form should be submitted
<form:form>
<input type="checkbox" id="check-box" name="<c:out value="${status.expression}"/>" value="
<c:out value="${status.value}"/>">
<input type="hidden" name="_<c:out value="${status.value}"/>">
<span onclick="submitForm('confirm')">Confirm</span>
<span onclick="submitForm('cancel')">Cancel</span>
</form:form>
<script type="text/javascript">
function submitForm(event){
if(document.getElementId('check-box').checked){
doc.form[0]._eventId_value=event;
doc.form[0].submit();
}
else
{
document.getElementId('check-box').style="border-style:solid,border-width:5px;"
}
}
</script>
I think you should use border:5px solid #ccc; or any color for that matter