I have a checkbox and a text box. I require that if the checkbox is checked, the text field becomes forced. Conversely, if the text field is full, the checkbox becomes forced.
So the sample will be
Element name - Checkbox - Expiration date Item name2 - checkbox2 - Validity period2
Data is retrieved from the database in an array using a query.
My code looks like
<script type="text/javascript">
$(document).ready(function(){
$("#sea").validationEngine();
});
function industry(field, rules, i, options) {
var atLeastOneIsChecked = $('input[name="extraqualification[]"]:checked').length > 0;
if (atLeastOneIsChecked == 1 ) {
if(document.getElementById('extraqualificationexpirydate<?php echo $extraqual['Id']?>').value=='')
{
return "Please supply a certificate expiry";
}else{} }
} </script>
source
share