[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with code...

At 09:32 AM 2/9/96 -0500, you wrote:
>Suppose I have a form with a <select> object in it and I want to precede 
>that object with a bit of text that says how many options are in it.  I 
>tried using this code:
><script language="JavaScript">
>document.write ("<p>There are " + 
>	document.myform.myselect.options.length + 
>	" options in the following select box."); 
><p><form method="POST" name="myform">
><select name="myselect">
><option>Option 1
><option>Option 2
><option>Option 3
>I keep getting a "myform has no properties" error.  Am I missing something?

If this is the way the code appears in your document, it seems to me the
list doesn't
yet exist for you to count the number of entries.  Also, I'm not sure
(though this would
be a good exercise) if an object exists before it's closed with its end tag
-- </FORM> in
this case.

-- Gordon