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
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