submitting a form

Results 1 to 2 of 2

Thread: submitting a form

  1. #1
    Join Date
    Dec 1969

    Default submitting a form

    I have 3 forms on a page. depending on whch one is selected, i pass the form name & page to submit to.<BR><BR>however ie4 objects to the following code.<BR>i get the &#039;object doesn&#039;t support this method or property&#039; error<BR><BR>function subform(page,frm)<BR>{<BR> document.all[frm].action = page;<BR> frm.submit();<BR>}<BR>can anyone help me find the error?

  2. #2
    Join Date
    Dec 1969

    Default You'll kick yourself...

    I know MSIE 3 didn&#039;t.<BR><BR>I also know that MSIE 4 was derived from MSIE 3 but MSIE 5 was a rewrite from the ground up. So maybe.<BR><BR>Oh! Wait! Maybe it is because you are asking JS to *implicitly* convert the "frm" *OBJECT* into a *NAME* in order to index into the all array! And JS 5 is more "forgiving" than JS 4 in coercing values from one type to another, that I know for sure!<BR><BR>So maybe this would work:<BR><BR>function subform(page,frm)<BR>{<BR>// need *name* of form:<BR>document.all[].action = page;<BR>// but here we really need the object:<BR>frm.submit();<BR>}<BR><BR>If that doesn&#039;t work, there is always this:<BR><BR>function subform(page,frm)<BR>{<BR>eval( &#039;document.&#039; + ).action = page;<BR>frm.submit();<BR>}<BR><BR>OH! I am silly! And so are you!<BR><BR>If you *CAN* do the frm.submit(), then that means you ALREADY have the frm object in hand, right??? SO WHY DO YOU TRY TO LOOK IT UP ***AGAIN***???<BR><BR>function subform(page,frm)<BR>{<BR>frm.action = page;<BR>frm.submit();<BR>}<BR><BR>??? WELL???<BR><BR>So go kick yourself. I just got through doing so to myself! Heh! Sometimes hard to see the forest for the trees, yes?<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts