Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > String.value and String.value.length doesn't works together in IE with JVM

Reply
Thread Tools

String.value and String.value.length doesn't works together in IE with JVM

 
 
Wee
Guest
Posts: n/a
 
      07-16-2003
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.len gth;
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.len gth;
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>


 
Reply With Quote
 
 
 
 
Richard Cornford
Guest
Posts: n/a
 
      07-16-2003
"Wee" <> wrote in message
news:3f153be4$...
> 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.

<snip>
> It works if I run only one of the statement above, but not both.
>No such problem in Mozilla or Opera.
> Bugs?
>
> pls comment.

<snip>
> function CalcWord(){
> var myMessage=document.Formcalc.splitword.value;
> document.writeln(myMessage);


The first document.writln opens, clears and replaces the current
document.

> var total_length=document.Formcalc.splitword.value.len gth;


So now there is no form and no textarea within it. ("document.Formcalc
is null or not an object")

> document.writeln(total_length); //missing here.

<snip>

You are lucky if it works in any browser.

Richard.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
When I turn on my PC, it works, works, works. Problem! Fogar Computer Information 1 01-17-2006 12:57 AM
MS JVM and Sun JVM problem Young-Jin Lee Java 3 01-21-2004 04:25 AM
Different behavior for newStringUTF() for Sun JVM and IBM Jvm Lasse Java 1 01-05-2004 07:49 PM
After rebooting my PC works, works, works! Antivirus problem? Adriano Computer Information 1 12-15-2003 05:30 AM
Re: Handling both MS JVM and Sun JVM Kevin Hooke Java 2 09-02-2003 05:31 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57