Breaking

Wednesday, November 28, 2012

show text in input textBox



<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var alerted_already;
var remark;
function theytyped(form) {
for (   j = 1;
j<=remark.length && remark[j]!=form.myoutxt.value;
j++){}
if (j>remark.length)
form.myoutxt.value = "Do not type here!";
return false;
}
function touched_frog() {
if (!alerted_already) {
                alerted_already = true;
}
return alerted_already;
}
function compute(form) {
for (var i = 1;
i<=remark.length && remark[i]!=form.myoutxt.value ;
i++){}
if (i==remark.length-1)      
alert("Thế nào ?");
if (i<remark.length)
form.myoutxt.value = remark[i+1];
else
form.myoutxt.value = remark[1];
}
function initArray() {
      this.length = initArray.arguments.length;
      for (var i = 0; i < this.length; i++)
        this[i+1] = initArray.arguments[i];
}
remark = new initArray( " dong thu 1 !",
                        " dong thu 2 !",
" dong thu n !");
alerted_already = false;
// End -->
</SCRIPT>
<FORM name="buttons" method="post" onSubmit="return false">
<p align="center"><br>
<input type="button" name="pushme" value="Click here" onClick="compute(this.form)"
onMouseOver="window.status='xxxxx'; return touched_frog()">
<input type="text" value=" " name="myoutxt" onBlur="theytyped(this.form)" onFocus="theytyped(this.form)"
onChange="theytyped(this.form)" size=35>
</FORM>

No comments:

Post a Comment