473,406 Members | 2,451 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,406 software developers and data experts.

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 8334
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.bursc...@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.bursc...@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, "shimmyshack" <matt.fa...@gmail.comwrote:
On 26 Feb, 19:20, mohammed.nagh...@gmail.com wrote:


On Feb 23, 12:58 am, Christoph Burschka <christoph.bursc...@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="setAction();">

and in setAction

function setAction()
{
document.formname.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, "shimmyshack" <matt.fa...@gmail.comwrote:
On 26 Feb, 19:20, mohammed.nagh...@gmail.com wrote:
On Feb 23, 12:58 am, Christoph Burschka <christoph.bursc...@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="setAction();">

and in setAction

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

}

But it didnt work.

Is it the right way to use?
well
document.getElementById('formID').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, "shimmyshack" <matt.fa...@gmail.comwrote:
On 26 Feb, 21:57, mohammed.nagh...@gmail.com wrote:


On Feb 26, 12:26 pm, "shimmyshack" <matt.fa...@gmail.comwrote:
On 26 Feb, 19:20, mohammed.nagh...@gmail.com wrote:
On Feb 23, 12:58 am, Christoph Burschka <christoph.bursc...@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="setAction();">
and in setAction
function setAction()
{
document.formname.action = 'default action';
}
But it didnt work.
Is it the right way to use?

well
document.getElementById('formID').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
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">...
10
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
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...
1
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
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...
3
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...
4
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...
2
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...
5
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...
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
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...
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...

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.