wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes javascript to submit form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "javascript to submit form" Watch "javascript to submit form" New topic
Author

javascript to submit form

AnilPrakash Raju
Ranch Hand

Joined: Jul 26, 2004
Posts: 137
Hi,

I need javascript to submit a form in a jsp.

Thanks

Anil
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
document.formName.submit();
AnilPrakash Raju
Ranch Hand

Joined: Jul 26, 2004
Posts: 137
Thank you very much

Anil
Nat Dickstein
Greenhorn

Joined: Feb 26, 2005
Posts: 4
If your form is inside a div-Layer you better use

document.divName.formName.submit();

to make it working in all browsers.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Originally posted by Nat Dickstein:
If your form is inside a div-Layer you better use

document.divName.formName.submit();

to make it working in all browsers.


WRONG!

Do not do this!

There is one form object to the page. aka: document.forms
divs do not matter, layers do not matter, elements do not matter.

Eric
Bhiku Mhatre
Ranch Hand

Joined: Apr 08, 2002
Posts: 127
Hello,
document.divName.document.formName.submit();
is needed for SHITscape 4.7. The evil empire(Netscape 4.7) intepreted div as a seperate document. But this approach is not needed for new Generation of netscape browsers.

Regards,
Bhiku.
[ March 11, 2005: Message edited by: Bhiku Mhatre ]

The difference between winner and loser is making things happen and letting things happen.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
My 2 cents:

AS I SAY! Who cares about a browser that has been around since I started coding years ago! It is outdated, it does not support crap. If a business stills says it needs supported, I would laugh at them and say give me $30,000 more a year for that <1% of web users! I think they would see the cost analysis....

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: javascript to submit form
 
Similar Threads
Self Submit Form
invoke java method when some event occur
jsp and javascript
using lookup dipatch with link
How call a servlet method