Javascript Error in IE 6

J

jitesh dundas

Hi Friends,

I am having this error in javascript . This error comes in IE6 but not
in Mozilla.

Can you help?

function startSpellCheck( baseUrl, /* Array of Form Elements */
elements )
{
alert("baseURL->"+baseUrl);
var params='?op=1';

for( var x = 0; x < elements.length; x++ )
{
alert("element-x="+x);
var form = elements[x].form;
alert("form in startspellcheck="+form);
var formsNumber = getFormsNumber( form );
alert("In start-spellchecker.js file--formnumber"+formsNumber);
params = params + '&element_' + x + '=forms['+formsNumber
+'].elements[\'' + elements[x].name

+'\']';
alert("params->"+params);
}


openCenteredWindow( baseUrl + 'spellcheck-entry.jsp' + params,
300, 200 );

}

The line->var form = elements[x].form;

is passing null value.

function getFormsNumber( form )
{
alert("in form->"+form);
var forms = document.forms;
alert("forms="+forms);
for( var x = 0; x < forms[x].length; x++ )
{
alert("in for loop.x="+x+"length="+forms[x].length);
if( forms[x] == form )
return x;
}

return -1; // Form not found
}

Regards,
Jitesh Dundas
 
E

Evertjan.

jitesh dundas wrote on 03 aug 2009 in comp.lang.javascript:
I am having this error in javascript . This error comes in IE6 but not
in Mozilla.

"this"?

You do not show the error.

Please debug and explayn.
 

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,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top