Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

form.reload vs. form.submit

Status
Not open for further replies.

rosn459

Programmer
Sep 18, 2003
37
0
0
US
I am trying to submit a form after I select a record from a select box. Once a record is selected, a js function is called. I can reload my form using form.reload within my javascript function. But, whenever I try to use form.submit within my javascript function, I get the following error:

"Object doesn't support this property or method".

Here is my JS:

function blahblah()
{querystr="Anotherform.html?emailaddress=#emailaddress#"";
newWindow=window.open(querystr,'newWin','width=300,height=300,scrollbars=1,resizble=1');
newWindow.focus();
document.form.submit();}

The name of the form I want to submit is Property.html.

Why does form.reload work and form.submit does not? How can I get property.html to submit after I have selected the correct e-mail address from the drop-down?
 
>> The name of the form I want to submit is Property.html

THe name of the FORM is Property.html or the name of the file is Property.html?

What does your actual <FORM> tag look like? It should be something along the lines of
[tt]<form action=&quot;WhateverProcessYouSubmitDataTo&quot; name=&quot;ActualNameOfYourForm&quot;>[/tt]

Where you would call document.ActualNameOfYourForm.submit() to submit the data.

[sub]Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.
[/sub]
 
My form tag on the parent page is
<form action=&quot;Property.html&quot; name=&quot;Property&quot;>

My child form is opened with a separate JS hyperlink from Property.html.

I am calling the document.Property.submit() from within within my javascript function that is on the child form.
 
>> that is on the child form.

Whereas the form is on the main page yeah? Then you need to refer to the opening page via the [tt]opener[/tt] reference. Try:
[tt]self.opener.document.Property.submit()[/tt]

[sub]Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.
[/sub]
 
I get this message:

self.opener.document.Property.submit() is null or not an object
 
Programmher,

I got the same message...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top