473,406 Members | 2,371 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.

Form input - back button

I have a web form that allows the user to enter several pieces of
information. They can then click to see the results (which takes them to a
report form). From this form, if the user clicks the Back button on the
browser - they are returned to the input form and all of their inputs are
what they had entered. However, in the results form I have some links that
when clicked launch new windows (via javascript using window.open).

So I have the link:

<a id='link' href="" onclick="return onBrowse(this.id)">Link</a>

Here is the onBrowse:

function onBrowse(id)
{
window.open("link.asp?id=" + id", "link", "");
return false;
}

If the user clicks on these links then closes the new window. Then the user
clicks the back button from the report form (taking them back to the input
form) - the input form is shown but their selections are lost (they are
returned to their default values). What exactly is going on and how can I
work around this behavior?

Any help would be most appreciated.

BBB
Jul 23 '05 #1
4 1945
On Wed, 13 Oct 2004 12:34:07 +0000, Billy Boone wrote:
If the user clicks on these links then closes the new window. Then the user
clicks the back button from the report form (taking them back to the input
form) - the input form is shown but their selections are lost (they are
returned to their default values). What exactly is going on and how can I
work around this behavior?


Do you *want* them to still have their selections? Or is a cleared form
what you are lookign for?

Either way, this browser behavior can be quite variable depending on what
browser the user is using and how things like cache and history are set
within that browser. You *cannot* depend on the browser for consistent
behavior.

When I create a form that I want the user's data to not be forgotten when
they submit but there is a mistake or missing required fields or something
like that, I

1) save all the data on the server side in a session
2) send them back to the form using server redirects, but the form is now
filled using the "value=" or "checked" or "selected" properties of the
form fields, based on the saved data.

I use PHP on the server but I'm sure ASP can do the same.

I *never* depend on the browser for consistent behavior. At least on the
server everything is *mine* and I know how it is configured and what it
will do.

--
Jeffrey Silverman
je**********@jhu.edu
** Drop "PANTS" to reply by email
Jul 23 '05 #2
I want them to still have their selections.

Yeah, I had considered both cookies and session variables. This is an
intranet application so this will be with IE 6.0 only.

"Jeffrey Silverman" <je**********@jhu.edu> wrote in message
news:pa***************************@jhu.edu...
On Wed, 13 Oct 2004 12:34:07 +0000, Billy Boone wrote:
If the user clicks on these links then closes the new window. Then the user clicks the back button from the report form (taking them back to the input form) - the input form is shown but their selections are lost (they are
returned to their default values). What exactly is going on and how can I work around this behavior?


Do you *want* them to still have their selections? Or is a cleared form
what you are lookign for?

Either way, this browser behavior can be quite variable depending on what
browser the user is using and how things like cache and history are set
within that browser. You *cannot* depend on the browser for consistent
behavior.

When I create a form that I want the user's data to not be forgotten when
they submit but there is a mistake or missing required fields or something
like that, I

1) save all the data on the server side in a session
2) send them back to the form using server redirects, but the form is now
filled using the "value=" or "checked" or "selected" properties of the
form fields, based on the saved data.

I use PHP on the server but I'm sure ASP can do the same.

I *never* depend on the browser for consistent behavior. At least on the
server everything is *mine* and I know how it is configured and what it
will do.

--
Jeffrey Silverman
je**********@jhu.edu
** Drop "PANTS" to reply by email

Jul 23 '05 #3
As per Jeffrey's suggestion, I'd use frames to get around your problem,
but there was something else I noticed...

Billy Boone wrote:
<a id='link' href="" onclick="return onBrowse(this.id)">Link</a>


This is a particularly nasty way of opening a new window. Try:

<a href="link.asp?id=" target="mylink"
onclick="return onBrowse(this.href,this.target)">Link</a>

with:

function onBrowse(u,t)
{
window.open(u,t);
return false;
}

Now your link will work when Javascript is disabled too.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

Jul 23 '05 #4
Gazing into my crystal ball I observed "Billy Boone"
<b3******@insightbb.com> writing in
news:D3abd.233271$MQ5.25041@attbi_s52:
"Jeffrey Silverman" <je**********@jhu.edu> wrote in message
news:pa***************************@jhu.edu...
On Wed, 13 Oct 2004 12:34:07 +0000, Billy Boone wrote:
> If the user clicks on these links then closes the new window. Then
> the user clicks the back button from the report form (taking them
> back to the input form) - the input form is shown but their
> selections are lost (they are returned to their default values).
> What exactly is going on and how can I work around this behavior?


Do you *want* them to still have their selections? Or is a cleared
form what you are lookign for?

Either way, this browser behavior can be quite variable depending on
what browser the user is using and how things like cache and history
are set within that browser. You *cannot* depend on the browser for
consistent behavior.

When I create a form that I want the user's data to not be forgotten
when they submit but there is a mistake or missing required fields or
something like that, I

1) save all the data on the server side in a session
2) send them back to the form using server redirects, but the form is
now filled using the "value=" or "checked" or "selected" properties of
the form fields, based on the saved data.

I use PHP on the server but I'm sure ASP can do the same.

I *never* depend on the browser for consistent behavior. At least on
the server everything is *mine* and I know how it is configured and
what it will do.

I want them to still have their selections.

Yeah, I had considered both cookies and session variables. This is an
intranet application so this will be with IE 6.0 only.


No reason it couldn't work cross browser, and you really don't have to use
session variables or cookies (which in the real world are not dependable).
You can use the information in the request.querystring collection, or you
can have the form post to itself.

I have an example of this with source code at
http://www.intraproducts.com/beta/requiredform.asp .
--
Adrienne Boswell
Please respond to the group so others can share
http://www.arbpen.com
Jul 23 '05 #5

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

Similar topics

10
by: Gregory A Greenman | last post by:
I'm trying to write a program in vb.net to automate filling out a series of forms on a website. There are three forms I need to fill out in sequence. The first one is urlencoded. My program is...
4
by: pizzy | last post by:
INTRO: I tried to clean it up for easy reading. I hope I didn't make any mistakes. PROBLEM: WOW, this is some crazy sh!t. I can't get my checkbox (see "TAGSELECTED") to print my textboxes (see...
2
by: umashd | last post by:
Hi, I am doing a web based project for my graduation. I studied bit of java for backend processesing and javascript for the client. Here is the scenario. In the FORM, I use INPUT TYPE=text...
5
by: Codeman II | last post by:
Hi there, I am building a form where the user must upload a picture and fill in his details. Now I have a problem as all of this is on the same form. How will I be able to have the Browse...
4
by: Alex Sibilev | last post by:
Hello, I have a really weird problem I've been trying to solve it without any luck for the last couple of hours :( I'm writing a "conference board" application (quite similar to ASP.NET...
4
by: jwlum | last post by:
I have the following problem under Internet Explorer only: 1. User fills out form data (myform.php) and clicks a button that fires myFunction() 2. myFunction() spawns a "hello, world" popup page...
7
by: Chuck Anderson | last post by:
I'm pretty much a JavaScript novice. I'm good at learning by example and changing those examples to suit my needs. That said .... ..... I have some select fields in a form I created for a...
4
by: Rolf Rosenquist | last post by:
From a page with a form I collect the fields in the next page. The fields are compared with a database and if a certain condition does not fit, I want to go back to the first page with the form,...
11
by: Twayne | last post by:
Hi, Newbie to PHP here, no C or other relevant background, so pretty niave w/r to the nuances etc. but I think this is pretty basic. XP Pro, SP2+, PHP 4.4.7, XAMPP Local Apache Server...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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
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...

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.