var custnum = document.getElementById('custnum'+rownum).value;
// if there is a custnum and more than one open invoice, enable
// (and check) the box
var custnum = document.getElementById('custnum'+rownum).value;
// if there is a custnum and more than one open invoice, enable
// (and check) the box