473,439 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,439 software developers and data experts.

Javascript - Onsubmit problem in Firefox

1
Hi,

Here's the first line of my HTML form...

Expand|Select|Wrap|Line Numbers
  1. <form target="_self" onsubmit="return preProcessForm();" action="somewhere" method="post">
preProcessForm looks like...

Expand|Select|Wrap|Line Numbers
  1. function preProcessForm()
  2. {
  3. var url = "pre_process_form.php";
  4.  
  5. run_AJAX_Request(url);
  6.  
  7. return true;
  8. }
I am trying to get pre_process_form.php to run in the background (using AJAX), prior to submitting the form. It works fine every time in IE 7/8, and it works 80% of the time in Firefox 3.0.11.

The problem occurs when the user submits the form. They are navigated to the appropriate destination, however, 20% of the time, the AJAX function appears to have not been called or the php script doesn't seem to have been called. I suspect this might be a FF bug but I'm trying to achieve some sort of short term work-around. The idea is - submit the form when pre_process_form.php has finished. Can anyone suggest something?
Jun 27 '09 #1
2 3552
Banfa
9,065 Expert Mod 8TB
I have moved your post to the correct forum, Javascript / AJAX. Please try to post in the correct forum using the links from the Topic menu as you will get a more rapid response if you do.

Banfa
Administrator
Jun 27 '09 #2
acoder
16,027 Expert Mod 8TB
What does pre_process_form do? If you're going to submit anyway (as in, a refresh/reload/unload of the page will take place), why not run this code in the action page?
Jun 28 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Gowhera Hussain | last post by:
Use This for Learning Only .... Do Not Try To Act Smart HACKING WITH JAVASCRIPT Dr_aMado Sun, 11 Apr 2004 16:40:13 UTC This tutorial is an overview of how javascript can be used to bypass...
2
by: horos | last post by:
just another thing.. for people who are trying to replace a url outside of a form and who are searching for an answer - when you are trying to use the document.location.replace("") method for going...
14
by: Rene Grothmann | last post by:
I have managed to communicate between forms and Java applets. A button press sends the content of the text area to an applet, a second button gets some text from the applet and puts it into the...
4
by: David McNerney | last post by:
Would anyone be able to tell me why I get an error in FireFox 1.5.0.1 for MacOSX when I type some text and hit Enter in the following form: <html> <body> <form action="http://example.com"...
10
by: ljlolel | last post by:
So.. I have a form that submits to an ASP.net site made in C-sharp. The ASP site is not mine, i do not have the server side code. When I submit from my form by pressing the Submit button, I get...
8
by: starsky51 | last post by:
I'm sure it's something i'm doing wrong, I just can't see it. I've set up a simple page with the following code: <html> <head> <title>tester</title> <script language="javascript"...
3
by: Igal | last post by:
hay. i'm working on some site, the code is pretty old, it has some form validation JS scripts. but seems like they work only in IE, won't work with FireFox. here's a example: <script...
5
by: Tomislav | last post by:
Hello, I tried to use "javascript:return confirm();" function in following manner ( triggered by form onSubmit event ): ** <form method="post" action="mail.php" onSubmit="javascript:return...
1
by: tgorton | last post by:
I am having a problem running a javascript function as part of an html-el:form onsubmit. The problem seems to exists in IE6 but not in Firefox. html: <html-el:form action="${target}"...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.