pls what is this error..

F

Frances Del Rio

for screen shot pls see
http://www.francesdelrio.com/error.gif

when viewing in netscape JS console it says 'document.phrase has no
properties', which is very weird.. 'document.phrase' refers to the
following:

<form name="form">
<input type=text name="phrase">


var form = document.form

function ff() {
form.phrase.focus() }

function ff() is called in onLoad event handler in body tag..

why does it say that document.phrase 'has no properties'? and why that
error in IE? I have gotten this same error before but it displays error
in usu. way, I had never seen it like this.. thank you.. Frances
 
R

Randy Webb

Frances said:
for screen shot pls see
http://www.francesdelrio.com/error.gif

when viewing in netscape JS console it says 'document.phrase has no
properties', which is very weird.. 'document.phrase' refers to the
following:


<form name="form">

form is not a good name for form.
<input type=text name="phrase">


var form = document.form
function ff() {
form.phrase.focus() }

function ff() is called in onLoad event handler in body tag..

why does it say that document.phrase 'has no properties'? and why that
error in IE? I have gotten this same error before but it displays error
in usu. way, I had never seen it like this.. thank you.. Frances

Because you are using shortcut syntax to attempt to access a form
control. Read the Group FAQ, via signature below, with regards to a
proper way to access forms and the elements within.


--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?
 
F

Frances Del Rio

mscir said:
Frances said:
when viewing in netscape JS console it says 'document.phrase has no
properties', which is very weird.. 'document.phrase' refers to the
following:

I'm not sure why that doesn't work, this works in my IE6, Netscape 7.2,
Firefox 1:

<script type="text/javascript">
function ff() {
document.forms['form1'].elements['phrase'].focus();
}
window.onload = ff;
</script>

indeed it does...... thank you very much... one truly wonders why the
other way it wouldn't work, it's standard dot-syntax... but.. what
works works... ;) thanks again.. Frances
 

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
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top