MediaWiki:Gadget-FormCheck.js: Difference between revisions

From Tsadra Foundation Advanced Contemplative Scholarships
((by SublimeText.Mediawiker))
((by SublimeText.Mediawiker))
Line 1: Line 1:
$(document).ready(function() {
$(document).ready(function() {
 
if( $('.MustField').filter(function() { return this.value === ''; }).length === 0 ) {
if( $('input[name="retreattype"]').val() === 'Three-year retreat') {
    console.log("All filled, setting status to 'Complete'.");
    if( $('.MustField, .ThreeMustField').filter(function() { return this.value === ''; }).length === 0 ) {
    $('input[name="status"]').val("Complete");
        console.log("All filled, setting status to 'Complete'.");
} else {
        $('input[name="status"]').val("Complete");
     console.log("All not filled");
    } 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...");
    }
}
}
});
});

Revision as of 07:00, 20 May 2024

$(document).ready(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...");
    }
}
});