Hi Rob, Thanks a lot for your help.
The major code is like this
In the HTML file I have the following JS Functions
--------------------------------------------------
/* Initializes the 'allForms' arry */
function initialize(doc)
{
top.initDocument(doc);
}
function submitForm(){
top.submitRequest("aaa",
url,
action,
func,
"",
new Array(""),
"_top");
}
....
/* Later I have the following Form in the same HTML */
/* The Hidden input are null and haveing name as null too will this
create any problems ? */
<form name="RESULT_FORM" method=POST>
<input type="hidden" name="" value="">
<input type="hidden" name="" value="">
<input type="hidden" name="" value="">
<input type="hidden" name="" value="">
<input type="hidden" name="" value="">
</form>
---------------------------------------------------------------------
The function 'initDocument()' creates the allForms array of forms and
the 'submitRequest()' method submits the record. While submitting the
form, we get the error in IE5+MacOS 9
---------------------------------------------------------------------
Code of submitRequest() is something like :
---------------------------------------------------------------------
function submitRequest( url, //Url to submit to
generalData, //Some other data
formNames, //Forms to be submitted
target,
method) // request method for form.
{
//We get the form here
var result= allForms["POR_RESULT_FORM"][0];
result.action= url;
result.target= target;
result.method= ((method=="GET" || target=="por_main") ? "GET" : "POST");
//we populate all the elements of the forms to be submitted to
//'result' object and then submit it
//Probably the point of error
result.submit();
}
---------------------------------------------------------------------
I think the problem is with the syntax of the last time 'result.submit();'
This works well in IE 5+ Win and fails saying
'RESULT_FORM.0 is not an object'
Please help.
--Ved
RobG wrote:
[...]
var result = allForms["RESULT_FORM"][0]
will create a reference to the first element in the form. Following is
a trivial case that works in IE 5 on OS 9 and IE 5.2 on OS X:
Forgot to add that if you want the value of the element (presuming it
is a text input) then use:
var result = allForms["RESULT_FORM"][0].value;