I have a couple of forms that are misbehaving in FireFox, but work fine in IE.
when i do submit( with submit button) a javascript function validates all of the fields entered, and stops the submission if there is an error.
Sample (obviously not working code):
[HTML] <html>
<head>
<script type="text/javascript">
function Submit()
{
// do something, like form field validation before submitting
return true;
} else {
return false; // do nothing, do not submit the form
}
}
</script>
</head>
<body>
<form name="myForm" action="form.cg i" onSubmit="retur n Submit()>
Some form fields here<br/>
<input type="submit" value="Submit" >
</form>
</body>
</html>
[/HTML]
THE PROBLEM:
In IE, the script performs as expected.
In FireFox (tested in v2.0.0.3):
* if the form validates correctly, it gets submitted twice:
* if the form doesn't validate then nothing happen.
Am I coding something wrong here? Why is FireFox submitting the form two times..
18 13130
I have a couple of forms that are misbehaving in FireFox, but work fine in IE.
when i do submit( with submit button) a javascript function validates all of the fields entered, and stops the submission if there is an error.
Sample (obviously not working code):
<html>
<head>
<script type="text/javascript">
function Submit()
{
// do something, like form field validation before submitting
return true;
} else {
return false; // do nothing, do not submit the form
}
}
</script>
</head>
<body>
<form name="myForm" action="form.cg i" onSubmit="retur n Submit()>
Some form fields here<br/>
<input type="submit" value="Submit" >
</form>
</body>
</html>
THE PROBLEM:
In IE, the script performs as expected.
In FireFox (tested in v2.0.0.3):
* if the form validates correctly, it gets submitted twice:
* if the form doesn't validate then nothing happen.
Am I coding something wrong here? Why is FireFox submitting the form two times..
I'm not a FireFox guru and am just trying my luck here,
What happens if you call the function onClick of the submit button rather than onSubmit of the form?
try to change the function name
try to change the function name
Of course. That should be it.
i tried to use onclick and the results are same.
btw, onclick event will take care of only mouse click.
but i need to make it generic,
I want to use all three cases.
a) submitting page by enter.
b) submitting page by click
c) submitting page by space when control is on submit button,
i have tried with changing function but no luck.
is there any other way, i can look on.
Thanks
i tried to use onclick and the results are same.
btw, onclick event will take care of only mouse click.
but i need to make it generic,
I want to use all three cases.
a) submitting page by enter.
b) submitting page by click
c) submitting page by space when control is on submit button,
i have tried with changing function but no luck.
is there any other way, i can look on.
Thanks
Can you post the code you have now with the function name changed
Firefox automaticqally follows the submit standard function after an event has occured when using a submit button...if you change the button type to button instead of submit and change the function name it will work normally. Unfortunatley you loose some of the other funtionality options you want but give a little to get a little. Sorry
Firefox automaticqally follows the submit standard function after an event has occured when using a submit button...if you change the button type to button instead of submit and change the function name it will work normally. Unfortunatley you loose some of the other funtionality options you want but give a little to get a little. Sorry
i found the solution afterall :)
the page was being loaded with GET method and issue was -- " mismatching of character encoding" ( hence GET was being executed Twice )
i used Central European ISO-8859-2 and everything is working fine
refer the below link for more details .. http://forums.mozillazine.org/viewto...859258#2859258
Regards
Navin
I'm still getting the problem. I've checked and set the charset encoding on the response header but with no luck [UTF-8]. FF still issues a Post and then a Get. Could someone please detail out how the solution is working for them.
One thing to note is that I use javascript to submit my form onchange of a text field. That should not make a difference.
The page meta tags -
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta http-equiv="Pragma" content="nocach e"/>
<meta http-equiv="Cache-Control" content="privat e"/>
<meta http-equiv="Cache-Control" content="proxy-revalidate"/>
Note I tried with the following as well -
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta http-equiv="Pragma" content="no-cache,no-store,max-age=0"/>
<meta http-equiv="Cache-Control" content="nocach e"/>
In my servlet I set the following
response.setHea der("Pragma", "No-cache");
response.setHea der("Cache-Control", "no-cache,no-store,max-age=0");
response.setHea der("Content-Type", "text/html; charset=UTF-8");
response.setDat eHeader("Expire s", 1);
Am I doing something wrong here?
acoder 16,027
Recognized Expert Moderator MVP
I'm still getting the problem. I've checked and set the charset encoding on the response header but with no luck [UTF-8]. FF still issues a Post and then a Get. Could someone please detail out how the solution is working for them.
One thing to note is that I use javascript to submit my form onchange of a text field. That should not make a difference.
The page meta tags -
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta http-equiv="Pragma" content="nocach e"/>
<meta http-equiv="Cache-Control" content="privat e"/>
<meta http-equiv="Cache-Control" content="proxy-revalidate"/>
Note I tried with the following as well -
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta http-equiv="Pragma" content="no-cache,no-store,max-age=0"/>
<meta http-equiv="Cache-Control" content="nocach e"/>
In my servlet I set the following
response.setHea der("Pragma", "No-cache");
response.setHea der("Cache-Control", "no-cache,no-store,max-age=0");
response.setHea der("Content-Type", "text/html; charset=UTF-8");
response.setDat eHeader("Expire s", 1);
Am I doing something wrong here?
What's the character encoding in your browser?
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: fogwolf |
last post by:
First a basic outline of what I am trying to do:
I want to have a page spawn a pop-up when you click "submit" on its
form. On this pop-up page there will be another form. When you click
"submit" on the pop-up's form I want the pop-up to close & a new page
to load in the "parent" window/page. I have this working in IE but
cannot get it to work in Firefox. The parent window correctly loads
the new page after submitting from the pop-up,...
|
by: chad.arimura |
last post by:
I've got a form inside a PHP script that posts to itself, does some
processing on the PHP side, and if it looks good, PHP sends a HEADER
command that redirects the user out. All was fine until I added a
button disabler onSubmit to keep users from submitting twice. Now the
form disables the button as requested but just refreshes the page... it
doesn't get to the HEADER command.
Any idea what the problem might be?
<script...
|
by: bedhead |
last post by:
Why doesn't a SELECT element's innerHTML reflected which option was
selected? Works in IE. I need this functionality so that I can retain
what choices a user made in a tabbed interface.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://w3.org/1999/xhtml">
<head>
<script language="javascript">
|
by: Nacho Nachev |
last post by:
This may sound like a silly question, but what is the appropriate way to
handle form double submitting in ASP.NET. Page expiration, etc? I am
looking for a way to handle this in some cetral point of the application
without affecting the web page implementation.
Thanks,
Nacho
|
by: Mark Olbert |
last post by:
The doPostBack javascript functioning is not submitting the page when called by linkbuttons (or an
autopostback checkbox, for that matter).
I'm aware of a problem with Netscape browsers and the postback code, but I have a workaround for
that installed (and it looks like the code generated by ASP.NET when it renders the page does the
same thing, namely, setting document<). However, the
problem still exists under firefox.
Has anyone come...
| |
by: Andrea |
last post by:
I am trying to alter css using javascript as well as use the innerHTML
function. I have pasted below 3 forms that access getElementById in
slightly different ways (I wanted to rule out that it was the method.)
All 3 work fine on IE but only work momentarily on Firefox. For
example, one form has text that changes from red to black when the user
clicks the button. In IE it changes. In Firefox it changes for a
split second then goes back...
|
by: gferreri |
last post by:
Hi all,
I've stumbled on an interesting problem with the way Firefox handles
form submitting with the enter key.
I'm putting together a page that has one form element with multiple
controls with their own textbox field and submit imagebuttons. I've
set up each control in an asp:Panel with their DefaultButton property
set to the proper button, so when the enter key is pressed, the proper
button event handler is triggered. This works...
|
by: mohammed.naghman |
last post by:
Hi,
I have 2 submit buttons in a jsp page. One of them takes me to
page2.jsp and also passes the values enetered to page2.I have a link
in the page2 that does a history.back to come to the previous page to
make any chnages necessary. Now after making my changes, instead of
going to page2.jsp if I want to submit the page, Instead of submitting
the page it takes me to page2.jsp again.
This problem is only with firefox. It works fine...
|
by: Ned White |
last post by:
Hi All,
Im my c# web project, users click a submit button for credit card payment
process.
On the web server side ( on ButtonClick_Event) the user's input(name,date,cc
number etc.) is processed and some transactional database processes are
taken based on the inputs.
My problem is, users may think that the button click did not work, so they
can click it again and again or they can refresh the all page by pressing
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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 then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |