• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in struts applicaion using javascript

 
deep pal
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
u are using struts 1.3 for our application in some of jsp we call javascript function
function submitAndresetFormWithEventonPress(url)
{
if(event.keyCode == 13 || event.which == 13){
document.forms[0].action=url;
document.forms[0].submit();
}

}
which is used for submittign action,now in this case it send two calls ..one which points to actual url and other one points to different wrong location..can anybody give suggection why it is happning how to resoved this problem....???...i am also using jstltag and custom libraries..
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the focus is on a submit button when you press enter, then there will be two submits: one triggered by the submit button, and one triggered by the JavaScript.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic