Quantcast
Channel: I want a textbox to be disabled when a textarea has nothing written inside it - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by Loarg Ann for I want a textbox to be disabled when a textarea has...

Just replace onkeydown by onkeyup. <input type="text" id="testUser" disabled="disabled" placeholder="username"> <textarea rows="15" cols="105" id="sql"></textarea> var ele =...

View Article



Answer by thebrownkid for I want a textbox to be disabled when a textarea has...

You can find a working snippet below - var txtarea = document.getElementById('sql'); var username = document.getElementById('testUser'); function enableUsername() { if (txtarea.value.length > 0) {...

View Article

I want a textbox to be disabled when a textarea has nothing written inside it

I want to be able to have a texbox enabled only when their is text written inside a certain textarea. I tried using the onkeydown attribute for the textarea with a method I wrote. It works when I...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images