Question
Button help again
I know this is probably and html and java question, but since
it is part of a cf app, I thought I would post here.
I have this and input field and checbox next to it. If the checkbox is not checked, then the input field is required. If the checkbox is check, then the input field is optional. Right now, the onvalidate will make it required all the time.
Can someone show me the javascript to validate (required) the input field only if the checkbox is not checked, and if the checkbox is checked, then it is optional ?
thanks
<cfinput type="text" name="return_to_supplier_supplier_number" onValidate="validateOptionTextBox" message="Supplier number is required" value="">
<cfinput type="checkbox" name="not_supplier" value="NRS"> Not a Supplier
I have this and input field and checbox next to it. If the checkbox is not checked, then the input field is required. If the checkbox is check, then the input field is optional. Right now, the onvalidate will make it required all the time.
Can someone show me the javascript to validate (required) the input field only if the checkbox is not checked, and if the checkbox is checked, then it is optional ?
thanks
<cfinput type="text" name="return_to_supplier_supplier_number" onValidate="validateOptionTextBox" message="Supplier number is required" value="">
<cfinput type="checkbox" name="not_supplier" value="NRS"> Not a Supplier