473,695 Members | 2,951 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.getPara meter("chkRefre sh");
String refreshCmd = "";

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

%>

<SCRIPT LANGUAGE="JavaS cript"><!--

<%=refreshCmd %>

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

//-->
</SCRIPT>

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

<% if (action.equalsI gnoreCase("off" )) { %>
<P><INPUT type="checkbox" name="chkRefres h"
onclick="setAut oRefresh()">Aut o Refresh OFF</P>
<%} else {%>
<P><INPUT type="checkbox" name="chkRefres h" onclick="setAut oRefresh()"
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...howe ver, 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 34315
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.js p" METHOD="get">

or

<FORM NAME="data" ACTION="test.js p">

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
4703
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 margin but the client wants the page to appear in the middle of the screen at higher resolutions but maintaining the fixed 800px width.. I've gone through the HTML Utopia : Designing Without Tables book and there seems to be no clue there on how...
2
2049
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 QueryString. (We'll call the page it goes to the "destination page".) If the user hits BACK on the destination page it should goto the "Auto Jump" page which should put you right back to where you hit the button. In Page_Load of this "Auto Jump"...
7
2252
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, with a few exceptions: 1) IE displays the FIle Download dialog box twice. (You have to click the Open button twice) 2) the encoding of the page is set to Western European (Windows) versus UTF-8. #1 above is just a pain. #2 above results in...
2
3013
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> <title>Title</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
13
7371
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 updating and writing in database, was MUCH more slower, than if I've this option turned off.
3
5380
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 resources by explicitly setting the value of the Page, but I want to use local resources as a standard. Thank you.
16
8372
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 -- each block contains three rows. this table is destined for paper printing. i would like to tell the browser *not* to bust up my blocks. rather, i would like it to smartly insert a page break inbetween <tbody>s if the last one cannot be rendered...
4
2802
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. Is that something that isn't there for all elements that are correctly formed, or possibly something that disappears due to malformed HTML? Or is there any other code-related reason (i.e., mistake) that causes it to disappear?
4
5956
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 content but only the main content side works, not quite sure what I am doing wrong CSS body { background-color: #e2dfc2; margin-left: 0px; margin-top: 0px;
1
3372
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 in my MasterPage, But the language doesn't change when I switch between them, Here is my code (Only pages that inherit from MasterPage): /******************** MasterPage.master ********************/ <asp:DropDownList ID="cmbCulture"...
0
8619
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
8555
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,...
1
8824
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,...
0
7651
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6484
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
5831
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
4336
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
2994
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
2
2258
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.