Fix non-cms forms

readwriteweb
Jaap Joris Vens 2020-02-14 22:03:25 +01:00
rodzic 3d66484afe
commit a7a640a721
4 zmienionych plików z 7 dodań i 6 usunięć

Wyświetl plik

@ -251,7 +251,7 @@ section.contactsection {
div#message { div#message {
display: none; display: none;
} }
textarea { textarea, input {
font-family: inherit; font-family: inherit;
} }
} }
@ -346,7 +346,7 @@ form.cms {
padding: 5px; padding: 5px;
} }
textarea { textarea {
height: 1px; height: 15em;
} }
input[type=checkbox] { input[type=checkbox] {

Wyświetl plik

@ -178,7 +178,7 @@ section {
section.contactsection div#message { section.contactsection div#message {
display: none; } display: none; }
section.contactsection textarea { section.contactsection textarea, section.contactsection input {
font-family: inherit; } font-family: inherit; }
/* Form elements */ /* Form elements */
@ -254,7 +254,7 @@ form.cms input, form.cms select, form.cms textarea {
padding: 5px; } padding: 5px; }
form.cms textarea { form.cms textarea {
height: 1px; } height: 15em; }
form.cms input[type=checkbox] { form.cms input[type=checkbox] {
width: auto; } width: auto; }

File diff suppressed because one or more lines are too long

Wyświetl plik

@ -68,7 +68,8 @@
// https://stackoverflow.com/a/25621277 // https://stackoverflow.com/a/25621277
var tx = document.getElementsByTagName('textarea'); var tx = document.getElementsByTagName('textarea');
for (var i = 0; i < tx.length; i++) { for (var i = 0; i < tx.length; i++) {
tx[i].setAttribute('style', 'height:' + (tx[i].scrollHeight) + 'px;overflow-y:hidden;'); tx[i].setAttribute('style', 'height:0;overflow-y:hidden;');
tx[i].style.height = (tx[i].scrollHeight) + 'px';
tx[i].addEventListener("input", OnInput, false); tx[i].addEventListener("input", OnInput, false);
} }
function OnInput() { function OnInput() {