Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Form submitting

 
PradeepPillai Pradeep
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<a href="#" onclick="submitIt();return false">

Eric
[ April 30, 2007: Message edited by: Eric Pascarello ]
 
PradeepPillai Pradeep
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you. That works.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic