"Tim Slattery" <Slattery_T@bls.gov> wrote in message
news:5v520158qes4ine9bplqb9g3pnp3mq9epc@4ax.com...[color=blue]
> "Amir" <webmaster@webfreeguide.com> wrote:
>[color=green]
> >I have a common Jscript function in my "common.js" file
> >It is:
> >
> >function submitForm(frm,action){
> >frm.action=action;
> >frm.submit();
> >return(false)
> >}
> >
> >
> >To submit my form fields to any other page I
> >
> >Use this function like this
> >
> ><A href="" onclick="return submitForm(myFormName,'\mydir\mypage.asp')">
> >sample link</A>
> >
> >This function works completely in IE 5+ but it doesn't work in
> >FireFox
> >
> >What is the problem?[/color]
>
> Instead of
>
> frm.action=action;
>
> try:
>
> document.getElementById(frm).action=action;
>
> where "frm" is the ID attribute of your form.[/color]
using the name attribute or index into the forms array seems to me the
safest way to reference the form.
IIRC the name att is a must in compliant browsers and is supported in all
UA's.
document.forms[0].etc
document.forms['idAtt'].etc
Jimbo
[color=blue]
> --
> Tim Slattery
>
Slattery_T@bls.gov[/color]