View Full Version : Urgent ! How to Enable a text field only when user enter 10 number ?

07-29-2008, 07:04 PM
Hello -
I want to create a text field and next to it are two text fields.
Only when the user enter 10 number, the two text fields should get enabled.

How to do this? :confused::confused:

Philip M
07-29-2008, 07:26 PM
<input type = "text" id = "number10" size = "6" onblur = "chk10()"><br>
<input type = "text" id = "txt1" size = "6" disabled><br>
<input type = "text" id = "txt2" size = "6" disabled><br>

<script type = "text/javascript">

function chk10() {
var x = document.getElementById("number10").value;
if (x == 10) {
document.getElementById("txt1").disabled = false;
document.getElementById("txt2").disabled = false;
else {
document.getElementById("txt1").disabled = true;
document.getElementById("txt2").disabled = true;

i raed a wlihe ago taht as lnog as the frsit and lsat lttesrs in a wrod are in the cerroct pcale msot of us wulod siltl be albe to raed bceause our barnis jsut looks at the frsit and lsat lttesrs.

07-29-2008, 07:30 PM
I copy and paste but.. is no working :O(

Philip M
07-29-2008, 07:43 PM
I copy and paste but.. is no working :O(

Well, it works fine for me. :rolleyes:

07-29-2008, 07:46 PM
my bad I missed something.. Thx :)