472,988 Members | 2,407 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Page auto-refresh and javascript

Lew
Hi all,

I'm trying to create a page that has a user-selectable page auto-refresh
option (IE 5.5). Essentially, it's a page that contains a checkbox, when
the user checks the checkbox, I'd like the page to auto-refresh every 4
seconds....if the user un-checks the checkbox, I'd like to turn off the auto
refresh.

The page is as follows:

<HTML>
<HEAD>

<%

String action = request.getParameter("chkRefresh");
String refreshCmd = "";

if (action != null) {
refreshCmd = "setInterval('window.location.reload()', 4000);";
} else {
refreshCmd = " ";
action = "off";
}

%>

<SCRIPT LANGUAGE="JavaScript"><!--

<%=refreshCmd %>

function setAutoRefresh() {
data.submit();
}

//-->
</SCRIPT>

<TITLE>test.jsp</TITLE>
</HEAD>
<BODY>
<FORM NAME="data" ACTION="test.jsp" METHOD="post">

<% if (action.equalsIgnoreCase("off")) { %>
<P><INPUT type="checkbox" name="chkRefresh"
onclick="setAutoRefresh()">Auto Refresh OFF</P>
<%} else {%>
<P><INPUT type="checkbox" name="chkRefresh" onclick="setAutoRefresh()"
checked>Auto Refresh ON</P>
<% } %>

</FORM>
</BODY>
</HTML>
This works in that it turns the auto-refresh on when the user checks the
"Auto Refresh" checkbox...however, I keep getting the following pop-up
message:

"The page cannot be refreshed without resending the information. Click Retry
to send the information again, or click Cancel to return to the page that
you were trying to view"

Is there anyway to avoid the above pop-up?

Thanks in advance.
Jul 20 '05 #1
1 34241
jon
Hi,

It the form method "post" that is causing that message to appear. If
you set it to "get", or do not define it, then that message will not
appear.

<FORM NAME="data" ACTION="test.jsp" METHOD="get">

or

<FORM NAME="data" ACTION="test.jsp">

The trade off is that the "chkRefresh" field will now be appended to
the url.

best,
jon

http://www.gurupika.com/
http://forums.gurupika.com/
Jul 20 '05 #2

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

Similar topics

4
by: Howard Martin | last post by:
I have a page at http://www.no1hastings.com.au/new/index.html designed for 800 x 600 resolution and where nearly all the elements are positioned using CSS. The elements are lined up to the left...
2
by: VB Programmer | last post by:
I created a page which I am using to prevent the user from hitting the BACK button. I'll call it my "Auto Jump" page. When it is called it basically auto-redirects to a page specified in the...
7
by: Brian Paul | last post by:
When a user clicks on a linkbutton on a page, i would like to render a printer-friendly version of the asp.net page and download it as an html attachment to the browser. The code below works great,...
2
by: tradmusic.com | last post by:
Hi, I'm new to CSS and, following some advice, created my page like this: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head>...
13
by: Matik | last post by:
Hello everybody, First: SQL Server 2000 sp3a, HP cluster server, MS 2003 server, database recovery model simple Torn page detection: When I have this option turned on, processes conected with...
3
by: Laith Zraikat | last post by:
I need to set the page title for a content page in a master page, and do that using local reources so that I can have my page title in different languages. I can do that easily using global...
16
by: matt | last post by:
hello, ive been trying to figure something out, largely thru trial & error. thought perhaps someone else may have knowledge. i have an html table that consists of blocks of related data --...
4
by: Steve | last post by:
I thought that this was available for all elements in Firefox, but recently had a page where a div didn't have it. I put in an id style for it, thinking that would do the trick, but it didn't. ...
4
by: camphor | last post by:
hi, I have a single column webpage with a rounded corner box which is positioned on the left in which the links sit, the main content is on the right, I am trying to make the page stretch with the...
1
JustRun
by: JustRun | last post by:
Hi, I'm developing a web site using asp.net with C#, this site contains a MasterPage, UserControles, Pages. What i need to do is to make my site supports MultiLanguage, so I put a dropDownList...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

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.