4
Answers

Simple condition for input text on loading page...

Israel

Israel

2y
538
1

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)