Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

strange behaviour on form submit in safari 3.0.4(523.12.9)

Posted on 2007-12-04
9
Medium Priority
?
318 Views
Last Modified: 2008-02-01
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
Comment
Question by:James Rodgers
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
9 Comments
 
LVL 23

Expert Comment

by:Ashish Patel
ID: 20406510
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
 
LVL 25

Author Comment

by:James Rodgers
ID: 20406582
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
 
LVL 23

Expert Comment

by:Ashish Patel
ID: 20406607
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
Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

 
LVL 25

Author Comment

by:James Rodgers
ID: 20406699
done that...same results
0
 
LVL 23

Expert Comment

by:Ashish Patel
ID: 20406727
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
 
LVL 25

Accepted Solution

by:
James Rodgers earned 0 total points
ID: 20406862
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
 
LVL 23

Expert Comment

by:Ashish Patel
ID: 20406882
Glad to hear this!!! So, always the basic is you try something different and look at all scopes. Good Luck.
0
 
LVL 1

Expert Comment

by:Vee_Mod
ID: 20641207
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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question