Connecting Tech Pros Worldwide Forums | Help | Site Map

Problem with Form Submit()

devanoy@hotmail.com
Guest
 
Posts: n/a
#1: Aug 17 '06
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();


jamieazure
Guest
 
Posts: n/a
#2: Aug 17 '06

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();
devanoy@hotmail.com
Guest
 
Posts: n/a
#3: Aug 17 '06

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();
devanoy@hotmail.com
Guest
 
Posts: n/a
#4: Aug 17 '06

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.
>
>
--
RobG
Guest
 
Posts: n/a
#5: Aug 18 '06

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

Closed Thread