Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invalid Syntax error in Javascript ??? 1

Status
Not open for further replies.

noorul

Programmer
Sep 13, 2001
4
0
0
FR
Hi,
I am trying to submit one JSP into the other and while doing this i am getting "Error:Invalid Syntax" error in IE 5.5 and 6.0. But in earlier versions of IE i am not at all getting any error but the JSP is submitted into the other JSP with all null values of the passed variables.
Please note that it's not Syntax error but it's "Invalid Syntax" error......
The same thing when i try in Netscape it's working perfectly fine.
On click of the button i have written this code only:
function funSubmit(){
document.frm.action = "def.jsp";
document.frm.submit();
}

In the error message (in only IE 5.5 and 6.0) it shows the line number next to document.frm.submit() statement.....
Moreover if i try to give any alert anywhere above the submit statement it is executed while running the program and but if i define the function like this:
function funSubmit(){
document.frm.action = "def.jsp";
document.frm.submit();
alert("hi!!");
}
it's not showing the alert message while the same is shown in Netscape where it's working perfectly fine.

Can anybody help me in this regard???
 
about the 2nd question (if alert is AFTER submit it isn't run) : it is a normal behaviour : submit() submits your page - so nothing can be done on the submitted page after this. Just that netscape has a weird timing. Just check by using onsubmit (in the form tag) instead of onclick (in a button tag) and you'll see this timing changing again [and for the 1st question, i'd suggest you use onsubmit instead of onclick, so you don't need the doc..frm.submit() line anymore, just the one to set the action]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top