Untitled

 avatar
unknown
plain_text
2 years ago
805 B
6
Indexable
function resetForm() {
    // Clear inputs and textarea
    $('input').val('');
    $('textarea').val('');
    $('#unit-label2').text('');
    $('#charCount').text('0/250');
    unitInput2.hide();
    unitInput.removeClass('col-4').addClass('col-12');
    $('.invalid-input').removeClass('invalid-input');
    unitInput.prop('disabled', true);

    // Reset category and source select elements
    categorySelect.empty().append(new Option("Välj kategori", "", true, true)).prop('disabled', true);
    sourceSelect.empty().append(new Option("Välj källa", "", true, true)).prop('disabled', true);
}


// Initialize form state
resetForm();

// Trigger change event on the first scope radio button to initialize categories
scopeRadios.first().prop('checked', true).trigger('change');
Editor is loading...