W
Wee
String.value.length 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=document.Formcalc.splitword.value;
document.writeln(myMessage);
var total_length=document.Formcalc.splitword.value.length;
document.writeln(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="JavaScript">
var userInput=new Array();
function CalcWord(){
var myMessage=document.Formcalc.splitword.value;
document.writeln(myMessage);
var total_length=document.Formcalc.splitword.value.length;
document.writeln(total_length); //missing here.
var code=myMessage.charCodeAt(6);
document.writeln(code);
var index2=myMessage.indexOf(" ");
document.writeln(index2);
}
</script>
</head>
<body>
<FORM name="Formcalc">
<textarea rows="10" cols="40" name="splitword">Please Type here </textarea>
<input type="button" value="Calculate" name="Calculate" onclick="CalcWord()"
/>
</FORM>
</body>
</html>
function in IE. I've no problem running either of this, but not together at
the same time.
var myMessage=document.Formcalc.splitword.value;
document.writeln(myMessage);
var total_length=document.Formcalc.splitword.value.length;
document.writeln(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="JavaScript">
var userInput=new Array();
function CalcWord(){
var myMessage=document.Formcalc.splitword.value;
document.writeln(myMessage);
var total_length=document.Formcalc.splitword.value.length;
document.writeln(total_length); //missing here.
var code=myMessage.charCodeAt(6);
document.writeln(code);
var index2=myMessage.indexOf(" ");
document.writeln(index2);
}
</script>
</head>
<body>
<FORM name="Formcalc">
<textarea rows="10" cols="40" name="splitword">Please Type here </textarea>
<input type="button" value="Calculate" name="Calculate" onclick="CalcWord()"
/>
</FORM>
</body>
</html>