Sha256: 4417656912fa45da2a57190739379d0066dc83720a92d3fc37c693821255f7e7

Contents?: true

Size: 348 Bytes

Versions: 5

Compression:

Stored size: 348 Bytes

Contents

function clearEmptyValues() {
    console.log('custom_inputs.js : clearEmptyValues');
    document.querySelectorAll('.custom-inputs--input-field').forEach((input) => {
        if (!input.value) {
            input.setAttribute('disabled', 'disabled');
        }
    });
}

$(document).ready(function () {
    $('form').submit(clearEmptyValues);
});

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
custom_inputs-0.1.4 app/assets/javascripts/custom_inputs/custom_inputs.js
custom_inputs-0.1.3 app/assets/javascripts/custom_inputs/custom_inputs.js
custom_inputs-0.1.2 app/assets/javascripts/custom_inputs/custom_inputs.js
custom_inputs-0.1.1 app/assets/javascripts/custom_inputs/custom_inputs.js
custom_inputs-0.1.0 app/assets/javascripts/custom_inputs/custom_inputs.js