Israel

Israel

  • 631
  • 1.3k
  • 217.4k

Simple condition for input text on loading page...

Dec 29 2022 10:45 AM

Hi, I have these codes and it's works well. But the problem is the button disabled ONLY when the input is filled. I would like that the button should be disabled on loading page if the a word is inside of input. Then if nothing is inside on loading page should still disabled. Thank you!

<script> 
function manage(txt) 
{ 
var bt = document.getElementById('btSubmit'); 
if (txt.value != '') 
{ 
bt.disabled = false; 
} 
else 
{ 
bt.disabled = true; 
} 
} 
</script>

 


Answers (4)