object expected - huh?

R

roN

Hi,

I'm trying a simple thing, trying to call this:
<script language="text/javascript">
<!--
function rating(){
alert(document.Form.00N30000000h5OG.value);
var capital=document.Form.00N30000000h5OG.value;
// alert(capital);
// document.write("rating: ");
}
//-->
</script>

out of this:
<input id="00N30000000h5OG" value="<? echo $_POST['00N30000000h5OG']?>"
maxlength="20" name="00N30000000h5OG" size="20" type="text"
onkeyup="javascript:rating()"/>

But it returns "object expected" and i have no clue why... been looking
around for a while but haven't found anything.
Help would be kindly appreciated!
Thank you!
Ron
 
L

Lee

David Mark said:
roN said:
Hi,

I'm trying a simple thing, trying to call this:
<script language="text/javascript">
<!--
function rating(){
alert(document.Form.00N30000000h5OG.value);
var capital=document.Form.00N30000000h5OG.value;
// alert(capital);
// document.write("rating: ");
}
//-->
</script>

out of this:
<input id="00N30000000h5OG" value="<? echo $_POST['00N30000000h5OG']?>"
maxlength="20" name="00N30000000h5OG" size="20" type="text"
onkeyup="javascript:rating()"/>

Get rid of the "javascript:" prefix in the onkeyup handler. It doesn't
belong there.

It doesn't hurt anything. The javascript parser considers
it to be a statement label which has no special meaning.

We haven't seen anything to convince us that the name of the
form is actually "Form".
Also note that values of the attribute NAME should begin with
an alphabetic character.


--
 
R

Richard Cornford

Lee said:
roN wrote:
<input id="00N30000000h5OG"
value="<? echo $_POST['00N30000000h5OG']?>"
maxlength="20" name="00N30000000h5OG" size="20" type="text"
onkeyup="javascript:rating()"/>
Also note that values of the attribute NAME should begin
with an alphabetic character.

Only in this case where the NAME attribute is (and should be) the same
as the ID attribute. NAME attributes are CDATA (except on META elements
where they are NAME tokens) and may contain any sequence of characters
"from the document character set" (as the HTML 4.01 specification puts
it). ID attributes are ID tokens and so begin with the upper or lower
case A-Z.

Richard.
 
T

Thomas 'PointedEars' Lahn

Lee said:
David Mark said:

It doesn't hurt anything.

With for this point strictly ECMAScript Ed. 3 conforming script engines,
which are known to not exist.
The javascript parser considers it to be a statement label
which has no special meaning.

Not true. It has a special meaning in MSHTML, although a seldom-used
one, as JavaScript, or rather JScript, is its default scripting language.
We haven't seen anything to convince us that the name of the
form is actually "Form".

Pluralis maiestatis? DID? Speak for your humble self only, please.
Also note that values of the attribute NAME should begin with
an alphabetic character.

Not true, they may begin with an underscore, too.


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,602
Members
45,182
Latest member
BettinaPol

Latest Threads

Top