Connecting Tech Pros Worldwide Help | Site Map

Problem with Form Submit()

 
LinkBack Thread Tools Search this Thread
  #1  
Old August 17th, 2006, 02:15 PM
devanoy@hotmail.com
Guest
 
Posts: n/a
Default Problem with Form Submit()

I have this function that doesn't seem to work on Internet Explorer,
but works on Firefox.

Below is the code. I get the form object. I set the action and I
submit the form. It is erroring out on the newForm.submit(); I am
getting "Object doesn't support this property or method". PLEASE HELP!

var newForm = document.getElementById('myForm');
newForm.action="action.asp";
newForm.submit();


  #2  
Old August 17th, 2006, 03:15 PM
jamieazure
Guest
 
Posts: n/a
Default Re: Problem with Form Submit()

does it work if you put the full call on the submit line:

i.e.

document.getElementById('myForm').submit();


devanoy@hotmail.com wrote:
Quote:
I have this function that doesn't seem to work on Internet Explorer,
but works on Firefox.
>
Below is the code. I get the form object. I set the action and I
submit the form. It is erroring out on the newForm.submit(); I am
getting "Object doesn't support this property or method". PLEASE HELP!
>
var newForm = document.getElementById('myForm');
newForm.action="action.asp";
newForm.submit();
  #3  
Old August 17th, 2006, 03:35 PM
devanoy@hotmail.com
Guest
 
Posts: n/a
Default Re: Problem with Form Submit()

Nope!

And I tried

document.all.forms(0).submit();
document.all.myForm.submit();
document.forms.myForm.submit();

All with the same result.!

There is no submit button...I am calling this function just based on a
link.

<a href="javascript:submitForm();" class="buttontextbig">Submit
Form</a>

<form method="post" id="myForm" name="myForm" style="margin:0;">

jamieazure wrote:
Quote:
does it work if you put the full call on the submit line:
>
i.e.
>
document.getElementById('myForm').submit();
>
>
devanoy@hotmail.com wrote:
Quote:
I have this function that doesn't seem to work on Internet Explorer,
but works on Firefox.

Below is the code. I get the form object. I set the action and I
submit the form. It is erroring out on the newForm.submit(); I am
getting "Object doesn't support this property or method". PLEASE HELP!

var newForm = document.getElementById('myForm');
newForm.action="action.asp";
newForm.submit();
  #4  
Old August 17th, 2006, 04:25 PM
devanoy@hotmail.com
Guest
 
Posts: n/a
Default Re: Problem with Form Submit()

NEVERMIND! It was one of those stupid mistakes that you spend all of
your time overlooking!

This is how I had my body tag. See the problem?
<body onload="javascript:init()")

There is a ) instead of a >.

Lee wrote:
Quote:
devanoy@hotmail.com said:
Quote:

I have this function that doesn't seem to work on Internet Explorer,
but works on Firefox.

Below is the code. I get the form object. I set the action and I
submit the form. It is erroring out on the newForm.submit(); I am
getting "Object doesn't support this property or method". PLEASE HELP!

var newForm = document.getElementById('myForm');
newForm.action="action.asp";
newForm.submit();
>
You haven't shown us the relevent HTML, in which you no doubt have
a control named "submit". Change the name of that control so that
newForm.submit correctly resolves to the method instead of to the
control object.
>
>
--
  #5  
Old August 17th, 2006, 11:25 PM
RobG
Guest
 
Posts: n/a
Default Re: Problem with Form Submit()


devanoy@hotmail.com wrote:
Quote:
NEVERMIND! It was one of those stupid mistakes that you spend all of
your time overlooking!
>
This is how I had my body tag. See the problem?
<body onload="javascript:init()")
>
There is a ) instead of a >.
You also have a useless "javascript:" label:

<body onload="init()">


--
Rob

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.