String.value.le ngth and String.value doesn't work together in a single
function in IE. I've no problem running either of this, but not together at
the same time.
var myMessage=docum ent.Formcalc.sp litword.value;
document.writel n(myMessage);
var total_length=do cument.Formcalc .splitword.valu e.length;
document.writel n(total_length) ; //missing here.
It works if I run only one of the statement above, but not both. No such
problem in Mozilla or Opera.
Bugs?
pls comment.
-------
<?xml version="1.0"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" language="JavaS cript">
var userInput=new Array();
function CalcWord(){
var myMessage=docum ent.Formcalc.sp litword.value;
document.writel n(myMessage);
var total_length=do cument.Formcalc .splitword.valu e.length;
document.writel n(total_length) ; //missing here.
var code=myMessage. charCodeAt(6);
document.writel n(code);
var index2=myMessag e.indexOf(" ");
document.writel n(index2);
}
</script>
</head>
<body>
<FORM name="Formcalc" >
<textarea rows="10" cols="40" name="splitword ">Please Type here </textarea>
<input type="button" value="Calculat e" name="Calculate " onclick="CalcWo rd()"
/>
</FORM>
</body>
</html>
function in IE. I've no problem running either of this, but not together at
the same time.
var myMessage=docum ent.Formcalc.sp litword.value;
document.writel n(myMessage);
var total_length=do cument.Formcalc .splitword.valu e.length;
document.writel n(total_length) ; //missing here.
It works if I run only one of the statement above, but not both. No such
problem in Mozilla or Opera.
Bugs?
pls comment.
-------
<?xml version="1.0"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" language="JavaS cript">
var userInput=new Array();
function CalcWord(){
var myMessage=docum ent.Formcalc.sp litword.value;
document.writel n(myMessage);
var total_length=do cument.Formcalc .splitword.valu e.length;
document.writel n(total_length) ; //missing here.
var code=myMessage. charCodeAt(6);
document.writel n(code);
var index2=myMessag e.indexOf(" ");
document.writel n(index2);
}
</script>
</head>
<body>
<FORM name="Formcalc" >
<textarea rows="10" cols="40" name="splitword ">Please Type here </textarea>
<input type="button" value="Calculat e" name="Calculate " onclick="CalcWo rd()"
/>
</FORM>
</body>
</html>
Comment