Requiring Minimum Values
// require notes on all airfare exceeding $1,000 dollars
function airfareCost() {
var cost = NSOA.form.getValue('cost');
var notes = NSOA.form.getValue('notes');
var item = NSOA.form.getValue('item_id');
if ( cost > 1000 && notes.length < 1 && item == '4' ) {
NSOA.form.error('notes', 'Notes are required for Airfare exceeding $1,000.');
}
}
See also: