MediaWiki:Gadget-FormCheck.js: Difference between revisions

From Tsadra Foundation Advanced Contemplative Scholarships
((by SublimeText.Mediawiker))
((by SublimeText.Mediawiker))
Line 15: Line 15:
         }
         }
     } else {
     } else {
         console.log("Retreat type not set.");
         console.log("Retreat type not set." + $('input[name="retreattype"]').val());
     }
     }
});
});

Revision as of 07:03, 20 May 2024

$('#TfacsSubmission input').on( "keyup", function() {
    if( $('input[name="retreattype"]').val() === 'Three-year retreat') {
        if( $('.MustField, .ThreeMustField').filter(function() { return this.value === ''; }).length === 0 ) {
            console.log("All filled, setting status to 'Complete'.");
            $('input[name="status"]').val("Complete");
        } else {
            console.log("Fields missing...");
        }
    } else if( $('input[name="retreattype"]').val() === 'Solitary hermitage') {
        if( $('.MustField, .SolMustField').filter(function() { return this.value === ''; }).length === 0 ) {
            console.log("All filled, setting status to 'Complete'.");
            $('input[name="status"]').val("Complete");
        } else {
            console.log("Fields missing...");
        }
    } else {
        console.log("Retreat type not set." + $('input[name="retreattype"]').val());
    }
});