473,511 Members | 14,393 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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.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>
Jul 20 '05 #1
1 4144
"Wee" <wt****@hotmail.com> wrote in message
news:3f**********@news.tm.net.my...
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.
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
4000
by: jake1138 | last post by:
Here is a function I have to get a number at the end of a string. I'm posting this in case it proves helpful to someone. Comments are welcome. int getnum(char *str) { char buffer; char *buf...
6
6084
by: Niyazi | last post by:
Hi all, What is fastest way removing duplicated value from string array using vb.net? Here is what currently I am doing but the the array contains over 16000 items. And it just do it in 10 or...
6
1707
by: bugnthecode | last post by:
I'm writing a program to send data over the serial port. I'm using pyserial, and I'm on WindowsXP. When I use literals I can get the data accross how I want it for example: 1 2 3 4...
7
7798
by: Sky | last post by:
I have been looking for a more powerful version of GetType(string) that will find the Type no matter what, and will work even if only supplied "{TypeName}", not the full "{TypeName},{AssemblyName}"...
34
2616
by: Larry Hastings | last post by:
This is such a long posting that I've broken it out into sections. Note that while developing this patch I discovered a Subtle Bug in CPython, which I have discussed in its own section below. ...
26
3773
by: Neville Lang | last post by:
Hi all, I am having a memory blank at the moment. I have been writing in C# for a number of years and now need to do something in VB.NET, so forgive me such a primitive question. In C#, I...
12
3192
by: Pascal | last post by:
hello and soory for my english here is the query :"how to split a string in a random way" I try my first shot in vb 2005 express and would like to split a number in several pieces in a random way...
1
8353
Atli
by: Atli | last post by:
The following small HowTo is a compilation of an original problem in getting some cookie-values through different methods of string-handling. The original Problem was posted as follows: As...
232
13066
by: robert maas, see http://tinyurl.com/uh3t | last post by:
I'm working on examples of programming in several languages, all (except PHP) running under CGI so that I can show both the source files and the actually running of the examples online. The first...
0
7251
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7148
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7367
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7430
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
5072
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3217
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
790
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
451
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.