aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Form submitting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Form submitting" Watch "Form submitting" New topic
Author

Form submitting

PradeepPillai Pradeep
Ranch Hand

Joined: Nov 15, 2005
Posts: 184
I do have a form that I am trying to submit using a link. I have the following function in the header

function submitIt()
{
document.forms[0].action="/Root/submitForm.do";
document.forms[0].submit();
}

and I have the following code in the form.

< href="javascript:void(0);" onKlick="javascript:submitIt();"> Click Here to Submit the Form </a>

When I submit it in Internet Explorer it is not going to the page specified by submitForm.do. But when I test it in Firefox, it works. Any idea why is this happening? How can I get it straight?
When I use a button to submit the form, it works both in IE and firefox.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
<a href="#" onclick="submitIt();return false">

Eric
[ April 30, 2007: Message edited by: Eric Pascarello ]
PradeepPillai Pradeep
Ranch Hand

Joined: Nov 15, 2005
Posts: 184
Thank you. That works.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Form submitting
 
Similar Threads
onsubmit: can you veto form submission without "return false"?
Form is submitting more than once
Bypassing form validation
Enabling and disabling Check Boxes
what are the possible reasons for request getting submitted twice?