Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 319
  • Last Modified:

strange behaviour on form submit in safari 3.0.4(523.12.9)

I have inherited a site that has the following in a form onSubmit

onSubmit="ValidateUserEdit(frm_UserEdit, '#sLanguageFlag#');return false"

the js validation has
if(error){
alert(strError)
}else{
frm.submit()
}

everything works fine except in safari 3.0.4 (win and mac) safari 2.0.4 also worked fine.
in testing, the validation is working, then the return is executed but regardless the form submits which results in an error in processing as while the action page is called the cf code says that the form object is not present so it cannot process the actions. short of rewriting the entire js, which is not in the budget/tim frame, i don't know what else to do, looking for suggestions....
thanks
0
James Rodgers
Asked:
James Rodgers
  • 4
  • 3
1 Solution
 
Ashish PatelCommented:
Try this if you are having just 1 form in your entire page.
document.forms[0].submit();

or else change the forms[0] with the name of your form like frm or whatever you have used.
document.frm.submit();
0
 
James RodgersWeb Applications DeveloperAuthor Commented:
the issue isnt with the frm.submit(), even if the validation fails something forces teh action page to be called without the form object getting sent to the action page.
0
 
Ashish PatelCommented:
1. Remove return false from the below line.

onSubmit="ValidateUserEdit(frm_UserEdit, '#sLanguageFlag#');return false"

2. Try modifying this in the function like below.

if(error){
alert(strError)
return false;
}else{
return true;
}
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
James RodgersWeb Applications DeveloperAuthor Commented:
done that...same results
0
 
Ashish PatelCommented:
Okay now last attempt. Just undo the 2nd point i gave and put back your original code.

if(error){
alert(strError)
}else{
frm.submit()
}
0
 
James RodgersWeb Applications DeveloperAuthor Commented:
found what it was....who ever wrote the code originally put an href AROUND the submit button
WTH is that?!!?!? so now im off to kick someone's ....
0
 
Ashish PatelCommented:
Glad to hear this!!! So, always the basic is you try something different and look at all scopes. Good Luck.
0
 
Vee_ModCommented:
Closed, 500 points refunded.
Vee_Mod
Community Support Moderator
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now