cssjs-func-lib/form.js
2020-08-11 12:59:54 +02:00

20 lines
634 B
JavaScript

addAutoresize = function() {
document.querySelectorAll('[data-autoresize]').forEach(function(element) {
element.style.boxSizing = 'border-box';
var offset = element.offsetHeight - element.clientHeight;
document.addEventListener('input', function(event) {
event.target.style.height = 'auto';
event.target.style.height = event.target.scrollHeight + offset + 'px';
});
element.removeAttribute('data-autoresize');
});
}
addAutoresize();
isset = function(id) {
if($('#'+id).val() == ''){
alert('Es wurden nicht alle Felder ausgefüllt.');
return false;
}
return true;
}