aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes problem using javascript 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 "problem using javascript" Watch "problem using javascript" New topic
Author

problem using javascript

deep pal
Greenhorn

Joined: Mar 19, 2008
Posts: 6
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....???...
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Well first off, that code should not run in all browsers.

Second is the form going to the original action in the form?

Eric
deep pal
Greenhorn

Joined: Mar 19, 2008
Posts: 6
nops it is not either going to form location....it is sending two request...one with proper url othr with wrong url which execute first...
 
wood burning stoves
 
subject: problem using javascript