Click to See Complete Forum and Search --> : What does this error means????
shanuragu
06-17-2003, 07:48 AM
HI
var cId=document.form.cn[document.form.cn.selectedIndex].value;
For this line of code
I am getting the following error
document.form.cn[..].value' is not an object.
What are the possible reasons for the above error.
ShaRa
Justin
06-17-2003, 08:04 AM
it usualy means that you didn't define the form name the same or something. it says that it cant find that form on the page
shanuragu
06-17-2003, 08:19 AM
Because
I have a form with a name 'form' and a list box by name 'cn'
Both names mentioned the code are existing!!.
Any other reason??
ShaRa
Justin
06-17-2003, 08:46 AM
this is a long shot but it mite work depending on the browser try adding
window.document.form.cm :confused: :(
shanuragu
06-17-2003, 08:56 AM
No it is not working!!!:confused: :mad:
Without code it is often hard to figure.
Are you using the line of code BEFORE the form is defined in the document?
Khalid Ali
06-17-2003, 09:27 AM
Originally posted by shanuragu
Because
I have a form with a name 'form' and a list box by name 'cn'
ShaRa
form is an element name and if you give a form name value form..don't you think you are trying to confuse the javascript engine???
Never assign name attribute value which is the name of that element.
Change the form elements name to "form1" or something else.And then if th eselect box has name="cn" then you are business