It's not a secret anymore!
The moose likes HTML, CSS and JavaScript and the fly likes Form submitting Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Form submitting" Watch "Form submitting" New topic
Author

Form submitting

PradeepPillai Pradeep
Ranch Hand

Joined: Nov 15, 2005
Posts: 183
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: 15362
    
    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: 183
Thank you. That works.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Form submitting
 
Similar Threads
what are the possible reasons for request getting submitted twice?
Enabling and disabling Check Boxes
Form is submitting more than once
onsubmit: can you veto form submission without "return false"?
Bypassing form validation