473,624 Members | 2,245 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

history.back() problem with firefox

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 with IE. Can anyone
help me on this?

Feb 22 '07 #1
7 8348
On 22 Feb, 22:17, mohammed.nagh.. .@gmail.com wrote:
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 with IE. Can anyone
help me on this?
we'd love to help I am sure, but can only do so if you provide details
of the code and make sure you question makes a bit more sense!!
what are the two pages called, page2.jsp and page2.jsp and why do you
have 2 submit buttons on the page? and what does the other one do?

Feb 23 '07 #2
mo************* *@gmail.com wrote:
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 with IE. Can anyone
help me on this?
I'll assume you made a typo and one of the pages mentioned is actually
called page1.jsp. Otherwise, this really doesn't make a lot of sense.

But without knowing where the typo is, it's practically impossible to
understand the question...

--cb
Feb 23 '07 #3
On Feb 23, 12:58 am, Christoph Burschka <christoph.burs c...@rwth-
aachen.dewrote:
mohammed.nagh.. .@gmail.com wrote:
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 with IE. Can anyone
help me on this?

I'll assume you made a typo and one of the pages mentioned is actually
called page1.jsp. Otherwise, this really doesn't make a lot of sense.

But without knowing where the typo is, it's practically impossible to
understand the question...

--cb
OK. Let me explain again.

I have Page1.jsp with 2 buttons. One button is used to navigate to
Page2.jsp and is a submit button. It submits the values enterd in
page1 to page2. This is done since some of the fields are common in
both pages and we do not want the user to re-enter the values if he
has already done so in page1.

The second button is again a submit button. But this one submits the
values of the fields entered in Page1.jsp and writes into the
database.

Now I use button1 and go to Page2.jsp, And I come back to page1.jsp
using a link that does a history.back(). I do this becoz I dont want
to enter anything in page2.jsp. So I come back to page1 and try to
submit the page using button2. Now instead of submitting the page and
writing to the databse, button2 behaves like button1 nad takes me to
page2.jsp again.

And this problem is only with firefox.

Feb 26 '07 #4
On 26 Feb, 19:20, mohammed.nagh.. .@gmail.com wrote:
On Feb 23, 12:58 am, Christoph Burschka <christoph.burs c...@rwth-

aachen.dewrote:
mohammed.nagh.. .@gmail.com wrote:
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 with IE. Can anyone
help me on this?
I'll assume you made a typo and one of the pages mentioned is actually
called page1.jsp. Otherwise, this really doesn't make a lot of sense.
But without knowing where the typo is, it's practically impossible to
understand the question...
--cb

OK. Let me explain again.

I have Page1.jsp with 2 buttons. One button is used to navigate to
Page2.jsp and is a submit button. It submits the values enterd in
page1 to page2. This is done since some of the fields are common in
both pages and we do not want the user to re-enter the values if he
has already done so in page1.

The second button is again a submit button. But this one submits the
values of the fields entered in Page1.jsp and writes into the
database.

Now I use button1 and go to Page2.jsp, And I come back to page1.jsp
using a link that does a history.back(). I do this becoz I dont want
to enter anything in page2.jsp. So I come back to page1 and try to
submit the page using button2. Now instead of submitting the page and
writing to the databse, button2 behaves like button1 nad takes me to
page2.jsp again.

And this problem is only with firefox.
I am assuming that you use javascript to changing the action of the
form in Page1.jsp to Page2.jsp when button1 is pressed, a change which
firefox preserves whereas IE "forgets".
Basically you want a single form with two buttons with different
names, one which said "submit this bit", and the other which is later
on that says "submit whole form" then the solution is to have both
buttons post back to Page1.jsp, if the submit button that was pressed
is button 1, then write out the form again (and add some js that jumps
them to the second section, and hey presto the user is back in the
page at the right place to carry on, if the second button is pressed
the great, let your server side logic show that. Having a dead page
isnt too good.
However if you do want to go that way have an onload statement that
initialises the form's action to whatever default you want it to be.
Personally I think having half a form submit is odd, if the data is
common to both things, then use a session to preserve state.

Feb 26 '07 #5
On Feb 26, 12:26 pm, "shimmyshac k" <matt.fa...@gma il.comwrote:
On 26 Feb, 19:20, mohammed.nagh.. .@gmail.com wrote:


On Feb 23, 12:58 am, Christoph Burschka <christoph.burs c...@rwth-
aachen.dewrote:
mohammed.nagh.. .@gmail.com wrote:
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 with IE. Can anyone
help me on this?
I'll assume you made a typo and one of the pages mentioned is actually
called page1.jsp. Otherwise, this really doesn't make a lot of sense.
But without knowing where the typo is, it's practically impossible to
understand the question...
--cb
OK. Let me explain again.
I have Page1.jsp with 2 buttons. One button is used to navigate to
Page2.jsp and is a submit button. It submits the values enterd in
page1 to page2. This is done since some of the fields are common in
both pages and we do not want the user to re-enter the values if he
has already done so in page1.
The second button is again a submit button. But this one submits the
values of the fields entered in Page1.jsp and writes into the
database.
Now I use button1 and go to Page2.jsp, And I come back to page1.jsp
using a link that does a history.back(). I do this becoz I dont want
to enter anything in page2.jsp. So I come back to page1 and try to
submit the page using button2. Now instead of submitting the page and
writing to the databse, button2 behaves like button1 nad takes me to
page2.jsp again.
And this problem is only with firefox.

I am assuming that you use javascript to changing the action of the
form in Page1.jsp to Page2.jsp when button1 is pressed, a change which
firefox preserves whereas IE "forgets".
Basically you want a single form with two buttons with different
names, one which said "submit this bit", and the other which is later
on that says "submit whole form" then the solution is to have both
buttons post back to Page1.jsp, if the submit button that was pressed
is button 1, then write out the form again (and add some js that jumps
them to the second section, and hey presto the user is back in the
page at the right place to carry on, if the second button is pressed
the great, let your server side logic show that. Having a dead page
isnt too good.
However if you do want to go that way have an onload statement that
initialises the form's action to whatever default you want it to be.
Personally I think having half a form submit is odd, if the data is
common to both things, then use a session to preserve state.- Hide quoted text -

- Show quoted text -
You are right. I am using javascript to change the action of the page
depending on which button is clicked.

I tried using the onload. This is how i used it

<body onload="setActi on();">

and in setAction

function setAction()
{
document.formna me.action = 'default action';
}

But it didnt work.

Is it the right way to use?

Feb 26 '07 #6
On 26 Feb, 21:57, mohammed.nagh.. .@gmail.com wrote:
On Feb 26, 12:26 pm, "shimmyshac k" <matt.fa...@gma il.comwrote:
On 26 Feb, 19:20, mohammed.nagh.. .@gmail.com wrote:
On Feb 23, 12:58 am, Christoph Burschka <christoph.burs c...@rwth-
aachen.dewrote:
mohammed.nagh.. .@gmail.com wrote:
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 with IE. Can anyone
help me on this?
I'll assume you made a typo and one of the pages mentioned is actually
called page1.jsp. Otherwise, this really doesn't make a lot of sense.
But without knowing where the typo is, it's practically impossible to
understand the question...
--cb
OK. Let me explain again.
I have Page1.jsp with 2 buttons. One button is used to navigate to
Page2.jsp and is a submit button. It submits the values enterd in
page1 to page2. This is done since some of the fields are common in
both pages and we do not want the user to re-enter the values if he
has already done so in page1.
The second button is again a submit button. But this one submits the
values of the fields entered in Page1.jsp and writes into the
database.
Now I use button1 and go to Page2.jsp, And I come back to page1.jsp
using a link that does a history.back(). I do this becoz I dont want
to enter anything in page2.jsp. So I come back to page1 and try to
submit the page using button2. Now instead of submitting the page and
writing to the databse, button2 behaves like button1 nad takes me to
page2.jsp again.
And this problem is only with firefox.
I am assuming that you use javascript to changing the action of the
form in Page1.jsp to Page2.jsp when button1 is pressed, a change which
firefox preserves whereas IE "forgets".
Basically you want a single form with two buttons with different
names, one which said "submit this bit", and the other which is later
on that says "submit whole form" then the solution is to have both
buttons post back to Page1.jsp, if the submit button that was pressed
is button 1, then write out the form again (and add some js that jumps
them to the second section, and hey presto the user is back in the
page at the right place to carry on, if the second button is pressed
the great, let your server side logic show that. Having a dead page
isnt too good.
However if you do want to go that way have an onload statement that
initialises the form's action to whatever default you want it to be.
Personally I think having half a form submit is odd, if the data is
common to both things, then use a session to preserve state.- Hide quoted text -
- Show quoted text -

You are right. I am using javascript to change the action of the page
depending on which button is clicked.

I tried using the onload. This is how i used it

<body onload="setActi on();">

and in setAction

function setAction()
{
document.formna me.action = 'default action';

}

But it didnt work.

Is it the right way to use?
well
document.getEle mentById('formI D').action = 'Page1.jsp';
would work better, but you could also add a clause to the onsubmit of
the form, so that depending on which button is pressed it changes the
action to the required value.
Sorry I didnt say that before, thats the way I would probably do it,
given that I _had_ to do it this way :)

Feb 26 '07 #7
On Feb 26, 3:16 pm, "shimmyshac k" <matt.fa...@gma il.comwrote:
On 26 Feb, 21:57, mohammed.nagh.. .@gmail.com wrote:


On Feb 26, 12:26 pm, "shimmyshac k" <matt.fa...@gma il.comwrote:
On 26 Feb, 19:20, mohammed.nagh.. .@gmail.com wrote:
On Feb 23, 12:58 am, Christoph Burschka <christoph.burs c...@rwth-
aachen.dewrote:
mohammed.nagh.. .@gmail.com wrote:
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 with IE. Can anyone
help me on this?
I'll assume you made a typo and one of the pages mentioned is actually
called page1.jsp. Otherwise, this really doesn't make a lot of sense.
But without knowing where the typo is, it's practically impossible to
understand the question...
--cb
OK. Let me explain again.
I have Page1.jsp with 2 buttons. One button is used to navigate to
Page2.jsp and is a submit button. It submits the values enterd in
page1 to page2. This is done since some of the fields are common in
both pages and we do not want the user to re-enter the values if he
has already done so in page1.
The second button is again a submit button. But this one submits the
values of the fields entered in Page1.jsp and writes into the
database.
Now I use button1 and go to Page2.jsp, And I come back to page1.jsp
using a link that does a history.back(). I do this becoz I dont want
to enter anything in page2.jsp. So I come back to page1 and try to
submit the page using button2. Now instead of submitting the page and
writing to the databse, button2 behaves like button1 nad takes me to
page2.jsp again.
And this problem is only with firefox.
I am assuming that you use javascript to changing the action of the
form in Page1.jsp to Page2.jsp when button1 is pressed, a change which
firefox preserves whereas IE "forgets".
Basically you want a single form with two buttons with different
names, one which said "submit this bit", and the other which is later
on that says "submit whole form" then the solution is to have both
buttons post back to Page1.jsp, if the submit button that was pressed
is button 1, then write out the form again (and add some js that jumps
them to the second section, and hey presto the user is back in the
page at the right place to carry on, if the second button is pressed
the great, let your server side logic show that. Having a dead page
isnt too good.
However if you do want to go that way have an onload statement that
initialises the form's action to whatever default you want it to be.
Personally I think having half a form submit is odd, if the data is
common to both things, then use a session to preserve state.- Hide quoted text -
- Show quoted text -
You are right. I am using javascript to change the action of the page
depending on which button is clicked.
I tried using the onload. This is how i used it
<body onload="setActi on();">
and in setAction
function setAction()
{
document.formna me.action = 'default action';
}
But it didnt work.
Is it the right way to use?

well
document.getEle mentById('formI D').action = 'Page1.jsp';
would work better, but you could also add a clause to the onsubmit of
the form, so that depending on which button is pressed it changes the
action to the required value.
Sorry I didnt say that before, thats the way I would probably do it,
given that I _had_ to do it this way :)- Hide quoted text -

- Show quoted text -
Thank you for the help provided. It works now with the above method. :)

Feb 27 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3214
by: Justin | last post by:
Hi, I have a simple frameset defined: ---------------- index.html ---------------- <FRAMESET COLS = "225,*"> <FRAME NAME = "a" SRC = "one.html"> <FRAME NAME = "b" SRC = "one.html"> </FRAMESET>
10
8056
by: pmelanso | last post by:
Hello, How can I tell if there is a page to go back to in the history or not??? Same with forward??? say something like/// if (there is a page to go back to ) { // DO something }else { }
5
2666
by: Alain | last post by:
I am currently working on an ASP.net application. In some situation when the Back button is pressed from the browser toolbar, Internet explorer displays me a cached page from the history. In other situation the previous page is regenerated (the page_load event is called). It is the same page but in a different sequence. In Firefox it works fine!! Alain
1
7447
by: DarthOptimus | last post by:
Hi, There is javascript code on my jsp to prevent double submission of a form: <SCRIPT type="text/javascript" language="JavaScript"> var firstSubmit = true; function isFirstSubmit() {
1
1798
by: BrainTop | last post by:
This is driving me nuts for last one week. Appreciate any assistance. I have ASP.NET web application with many pages. Some of them post back to itself and then links to another page. Everything was working great so far. Recently we did some modifications (included a new page) and after that things have gone ugly. This is the issue: Lets say the user has browsed through number of pages, came to one particular page (search), posted the...
3
2239
by: Niall | last post by:
When I say 'last', I mean (eg.) the 100th item in a 100-item history list, *not* the immediately previous one! The problem is, the history.go() method only allows *relative* movement through the history list. I need to go directly to the end -- an *absolute* movement -- and there doesn't appear to be any way of finding out the number of 'steps' that would require. Ideally, what I would use would be something of the form:
4
10100
by: Heinrich Wolf | last post by:
Hi all I have a history.back() problem with FF(2). IE works as expected, while FF does not. The multi frame website setup as a whole with a lot of frame content switching works flawlessly in both browsers. In one situation and frame I have a long scrollable list of cars offered for sale. Some list lines are linked to a separate page with images, to be loaded into the same frame as the listing. On closing this image page with <a...
2
2306
by: Vighneswar | last post by:
Hi All Please let me know is there any way to clear the address bar history ( Typed URLs) of Firefox browser programmatically. Deleting 'index.dat' under profiles folder of firefox will delete both ( history and Typed URLs ). Here I need to clear only the address bar history of firefox. Also is there any way to programmatically delete IE7 browser history on Windows Vista. I could able to delete IE7 browser history on Xp machine, but...
5
1596
hsriat
by: hsriat | last post by:
I add a link on the onload event of the body. The link is displayed as BACK if the page is opened from another page, but if the page is opened in a new window, its displayed as CLOSE Here's the function. function loadLink() { document.getElementById('link').innerHTML = history.length>1 ? '<a class="button" href="#back" onclick="history.back();return false;">&nbsp;Go Back&nbsp;</a>' : '<a class="button" href="#close"...
0
8233
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8170
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8675
Oralloy
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...
0
8619
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 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...
1
8334
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6108
isladogs
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...
0
5561
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();...
0
4078
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2604
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 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.