Solved

strange behaviour on form submit in safari 3.0.4(523.12.9)

Posted on 2007-12-04
9
316 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
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…
Suggested Courses

739 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