473,698 Members | 2,246 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Refresh the Page

I'm doing a page which gathers some text in the form of a text box in a
<form>. This text is saved to a text file, notices.txt and I want to be able
to display the saved text on the page, as soon as they click the SUBMIT
button - is this possible?

At the moment I have a hyperlink called "back" which, once they have entered
the text and they click SUBMIT, the "back" hyperlink will refresh the page
and it displays the newly entered text. However, I want to avoid them having
to press two things in order to see the text they have entered.. i.e., can
the submit button also totally refresh the page and display the newly
entered text?

Thanks
Laura TD
Jul 22 '05 #1
6 3329
"laura" <re*****@group. com> wrote in message
news:Oo******** ******@TK2MSFTN GP10.phx.gbl...
I'm doing a page which gathers some text in the form of a text box in a
<form>. This text is saved to a text file, notices.txt and I want to be able to display the saved text on the page, as soon as they click the SUBMIT
button - is this possible?

At the moment I have a hyperlink called "back" which, once they have entered the text and they click SUBMIT, the "back" hyperlink will refresh the page
and it displays the newly entered text. However, I want to avoid them having to press two things in order to see the text they have entered.. i.e., can
the submit button also totally refresh the page and display the newly
entered text?

Thanks
Laura TD


"... can the submit button also totally refresh the page and display the
newly entered text? -- Yes

However, I have a few questions ...
Where does notices.txt reside -- on the client or on the server?

If on the client you'll have security issues.

If on the server, it will be replaced by every form-filling visitor.
Is the text file formatted so you can display it as-is, or do
you want to read it first so you can format the display?
You could offer a link to the text file which, when clicked,
will open it up in a (optionally new) browser windows.

For example,
<a href="notices.t xt">notices.txt </a>
or
<a href="notices.t xt" target="_blank" >notices.txt</a>
presuming it is on the server in the same folder as your page.

Jul 22 '05 #2
Thanks for your swift reply.

After I sent the post, I realised I had not been too clear.. my apologies.

notices.txt will be on the server. It's going to be on an intranet. Only one
paragraph of text will be saved at any one time and the idea is that only
one person will ever actually edit this text, via a password protected area
of the website and possibly on a daily basis and the results will be
displayed on the home page of the intranet as "Daily Notices".

The person entering the text will see the previous day's Notice at the top
of the screen, and I am doing this with <!--#INCLUDE FILE="notices.t xt"-->,
which works fine the first time they open the page. Underneath the "old"
notice will be a <FORM> with one text box for them to fill in, and a SUBMIT
button to submit the new text. When they click the SUBMIT button, the text
gets saved immediately to notices.txt.

It is at this point that I want the newly saved text to be displayed once
again at the top of the (refreshed) page, with a black <FORM> underneath,
giving them the opportunity to read what they wrote and possibly change it
if they wish.

I seem to be able to achieve this only if I have a "back" button (<a
href="notices.a sp">Back</a> which just totally reloads the page and then
seems to read in the newly entered text. The form says <FORM
action="notices .asp" method="post">.

I'm not sure why the SUBMIT button does not do the same "job" as the back
button and totally refresh the page with the newly entered and saved text.
I'm confused.

I hope this explains it a bit better.
Is the text file formatted so you can display it as-is, or do
you want to read it first so you can format the display?
Formatting is not a problem, I just want to display the most currently
entered text.

This text will then also be displayed on the home page of the intranet.

Laura
"McKirahan" <Ne**@McKirahan .com> wrote in message
news:uq******** ************@co mcast.com... "laura" <re*****@group. com> wrote in message
news:Oo******** ******@TK2MSFTN GP10.phx.gbl...
I'm doing a page which gathers some text in the form of a text box in a
<form>. This text is saved to a text file, notices.txt and I want to be

able
to display the saved text on the page, as soon as they click the SUBMIT
button - is this possible?

At the moment I have a hyperlink called "back" which, once they have

entered
the text and they click SUBMIT, the "back" hyperlink will refresh the
page
and it displays the newly entered text. However, I want to avoid them

having
to press two things in order to see the text they have entered.. i.e.,
can
the submit button also totally refresh the page and display the newly
entered text?

Thanks
Laura TD


"... can the submit button also totally refresh the page and display the
newly entered text? -- Yes

However, I have a few questions ...
Where does notices.txt reside -- on the client or on the server?

If on the client you'll have security issues.

If on the server, it will be replaced by every form-filling visitor.
Is the text file formatted so you can display it as-is, or do
you want to read it first so you can format the display?
You could offer a link to the text file which, when clicked,
will open it up in a (optionally new) browser windows.

For example,
<a href="notices.t xt">notices.txt </a>
or
<a href="notices.t xt" target="_blank" >notices.txt</a>
presuming it is on the server in the same folder as your page.

Jul 22 '05 #3
"laura" <re*****@group. com> wrote in message
news:Of******** ******@TK2MSFTN GP14.phx.gbl...
Thanks for your swift reply.

After I sent the post, I realised I had not been too clear.. my apologies.

notices.txt will be on the server. It's going to be on an intranet. Only one paragraph of text will be saved at any one time and the idea is that only
one person will ever actually edit this text, via a password protected area of the website and possibly on a daily basis and the results will be
displayed on the home page of the intranet as "Daily Notices".

The person entering the text will see the previous day's Notice at the top
of the screen, and I am doing this with <!--#INCLUDE FILE="notices.t xt"-->, which works fine the first time they open the page. Underneath the "old"
notice will be a <FORM> with one text box for them to fill in, and a SUBMIT button to submit the new text. When they click the SUBMIT button, the text
gets saved immediately to notices.txt.

It is at this point that I want the newly saved text to be displayed once
again at the top of the (refreshed) page, with a black <FORM> underneath,
giving them the opportunity to read what they wrote and possibly change it
if they wish.

I seem to be able to achieve this only if I have a "back" button (<a
href="notices.a sp">Back</a> which just totally reloads the page and then
seems to read in the newly entered text. The form says <FORM
action="notices .asp" method="post">.

I'm not sure why the SUBMIT button does not do the same "job" as the back
button and totally refresh the page with the newly entered and saved text.
I'm confused.

I hope this explains it a bit better.
Is the text file formatted so you can display it as-is, or do
you want to read it first so you can format the display?


Formatting is not a problem, I just want to display the most currently
entered text.

This text will then also be displayed on the home page of the intranet.

Laura


[snip]

Are you using a <textarea> to enter the text?

If so, just have to notices.txt data in on page load.

This allows them to:
a) see what it contains;
b) allows them top modify it.

No Back button needed.

( include a "type=reset " button.)
Jul 22 '05 #4
Hi,
Are you using a <textarea> to enter the text?
If so, just have to notices.txt data in on page load.
Yes, displaying text in <textarea>, not sure what you meant by the next
sentence, I guess it was something line "add" notices.txt... This would
work, but I really wanted to "display" what had been added to the text file
before the user moved on - it would act as a confirmation. I just do not
understand why the <!--#INCLUDE PAGE--> does not re-display the newly
entered text when the page is (apparently) refreshed. I actually want to
eliminate the need for the Back button and have the page completely refresh
and show the newly entered data.

Laura

"McKirahan" <Ne**@McKirahan .com> wrote in message
news:SL******** ************@co mcast.com... "laura" <re*****@group. com> wrote in message
news:Of******** ******@TK2MSFTN GP14.phx.gbl...
Thanks for your swift reply.

After I sent the post, I realised I had not been too clear.. my
apologies.

notices.txt will be on the server. It's going to be on an intranet. Only

one
paragraph of text will be saved at any one time and the idea is that only
one person will ever actually edit this text, via a password protected

area
of the website and possibly on a daily basis and the results will be
displayed on the home page of the intranet as "Daily Notices".

The person entering the text will see the previous day's Notice at the
top
of the screen, and I am doing this with <!--#INCLUDE

FILE="notices.t xt"-->,
which works fine the first time they open the page. Underneath the "old"
notice will be a <FORM> with one text box for them to fill in, and a

SUBMIT
button to submit the new text. When they click the SUBMIT button, the
text
gets saved immediately to notices.txt.

It is at this point that I want the newly saved text to be displayed once
again at the top of the (refreshed) page, with a black <FORM> underneath,
giving them the opportunity to read what they wrote and possibly change
it
if they wish.

I seem to be able to achieve this only if I have a "back" button (<a
href="notices.a sp">Back</a> which just totally reloads the page and then
seems to read in the newly entered text. The form says <FORM
action="notices .asp" method="post">.

I'm not sure why the SUBMIT button does not do the same "job" as the back
button and totally refresh the page with the newly entered and saved
text.
I'm confused.

I hope this explains it a bit better.
> Is the text file formatted so you can display it as-is, or do
> you want to read it first so you can format the display?


Formatting is not a problem, I just want to display the most currently
entered text.

This text will then also be displayed on the home page of the intranet.

Laura


[snip]

Are you using a <textarea> to enter the text?

If so, just have to notices.txt data in on page load.

This allows them to:
a) see what it contains;
b) allows them top modify it.

No Back button needed.

( include a "type=reset " button.)

Jul 22 '05 #5
I think your problem is that include files are processed before scripts. So
first the submitted page reads the include file, which still contains the
old text, then it runs the script, which updates the include file.

"laura" <re*****@group. com> wrote in message
news:Oo******** ******@TK2MSFTN GP10.phx.gbl...
I'm doing a page which gathers some text in the form of a text box in a
<form>. This text is saved to a text file, notices.txt and I want to be able
to display the saved text on the page, as soon as they click the SUBMIT
button - is this possible?

At the moment I have a hyperlink called "back" which, once they have entered
the text and they click SUBMIT, the "back" hyperlink will refresh the page
and it displays the newly entered text. However, I want to avoid them having
to press two things in order to see the text they have entered.. i.e., can
the submit button also totally refresh the page and display the newly
entered text?

Thanks
Laura TD

Jul 22 '05 #6

"laura" <re*****@group. com> wrote in message
news:#k******** ******@TK2MSFTN GP15.phx.gbl...
I just do not
understand why the <!--#INCLUDE PAGE--> does not re-display the newly
entered text when the page is (apparently) refreshed. I actually want to
eliminate the need for the Back button and have the page completely refresh and show the newly entered data.

The thing about #include is that it is 'pre-processed', i.e. executed before
any scripting on your page. Since your script is extracting the text from
the form, doing whatever formatting/validation you need and then saving the
text to the file, its too late - the #include has already been processed.

What I suggest in outline is something like the following (assuming the page
in question is called {dailynews.asp} :

<html>
<!--- etc --->
<%
' the page is invoked with dailynews.asp?o ption=update or whatever other
code functionality you need to support
' First, check if the user is authorised to edit the Daily News text.
' If so, set the variable boolIsEditor to TRUE
' etc
' Now work out what the page needs to do ...
Select Case TRIM(Request.qu erystring("opti on"))

'############## ############### ############### ############### #########
Case "update"
'############## ###########
' Extract the text from the form, stick it in a variable called
strCurrentText and update the text file
' etc

' Add any other cases

'############## ############### ############### ############### #########
Case else
' the default
'############## ###########
' read the text from the file and put it into strCurrentText
' etc

End Select
%>

<body>
<h1>Daily News</h1>
<p><% = strCurrentText %>
<%
if boolIsEditor = TRUE Then
%>
<h2>Edit daily news</h2>
<form action="dailyne ws.asp?option=s ave" method="post">
<textarea name="editfield " rows="4" id="editfield"> <% = strCurrentText
%></textarea>
<!--- etc --->
</form>
<%
end if
%>
</body>
</html>

Note:

(1) You can add any other functionality you need on the page using Select
Case

(2) You can trap situations where the text file does not exist and simply
have an empty string in the variable - #include will fall over.

(3) The edit form only appears if the user is authorised to edit the text -
one page for both categories of user

Hope this helps

NeilS
Jul 22 '05 #7

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

Similar topics

3
12916
by: Scott | last post by:
I have a clickable graph that resides on page 1. If user clicks a data point on the graph, the page runs again yeilding a 2nd graph that shows a more detailed graph. Problem is, I have a recordset table on the 2nd graph page and because the user gets to it by clicking the graph, the page doesn't properly post to render the recordset table. I can click "Refresh" on 2nd page and table displays fine. Is there an ASP refresh command that...
1
10855
by: Marco Maroni | last post by:
How to force image refresh on client browser ? Is ti possible to force the refresh of the same image (tha was changed server-side) to the client, without user press Contrl+F5 in IE ? - Marco
2
23500
by: Jeronimo Bertran | last post by:
Hi, I have a page with a very data intensive grid which needs to be automatically refreshed constantly if a change is detected. In order to not refresh the complete page so often, I created an iframe on my page whose html has the refresh meta as follows : <meta http-equiv="refresh" content="10"> The iframe is effectivelyh refreshed every 10 seconds without having the
1
3145
by: francois | last post by:
I have a ASPX form with a dropdownlist that makes a post back (to the same page of course, just a normal asp.net postback) That page also has an auto refresh javascript as it needs to refresh its data automatically. The problem is that when i click on the dropdownlist, i post back information to the page, then after that the next refresh will brin me a alert message populated by internet explorer saying: "The page cannot be refreshd...
9
7763
by: PK9 | last post by:
I'm having an issue with the "Refresh" of an asp.net page. The refresh is actually calling my last onClick event. I thought that asp.net was supposed to be stateless in that it shouldn't remember that I clicked a button before the refresh. Here is what is going on: 1) Page Loads 2) User enters some values, clicks the "Save" button 3) The onClick event handler for the save button saves the data to the database and the page is...
0
1678
by: Brad White | last post by:
Overview: I have a custom web app that has an 'Inbox' that refreshes every 30 seconds. One user uses Outlook to host the web page. Using IE, the refresh works fine. If the user is working in another window, the web page quietly refreshes in the background. Hosted in Outlook, the refresh causes Outlook to come to the front on every refresh. Or in XP, causes the toolbar icon to flash.
3
2108
by: Kevin | last post by:
Hi guys, I want to refresh some pages every 2 seconds. however, these html pages are not in my site, they could be any pages from yahoo.com or msn.com. I can create a page, which redirect to public internet html page, but how can I do this in a loop? do I need to write a console application to make it work? thanks
8
9399
by: Jason S | last post by:
Hi, is there any way of getting my VB (6.0) program to automatically 'Refresh' an IE window that might be active (window status not applicable). It needs to be able to determine which active IE window to refresh, based on its caption. For example, there is a web site that I want to keep active where I normally have to refresh it manually before it times out (every 15 min or so). I might be doing something else at the time so I don't...
10
32875
by: phforum | last post by:
Hi, I wrote a PHP page for user input the information to search the database. And the database data will update every second. I want to set the auto refresh to get the data from database every minute. But the page always display the dialog box ask me to resend the information. How to disable this warning message. I using POST and REQUEST to get the data from user input page. Thanks all
5
3745
by: =?Utf-8?B?Sm9obg==?= | last post by:
Hi, I used the following code to refresh the parent page, and it works very well (Thanks to Peter Bromberg "). Response.Write("<script language='javascript' type='text/javascript'{ window.opener.location = 'Default.aspx?Reload=100'; }</script>"); Response.Write("<script language='javascript' type='text/javascript'{ self.close(); }</script>");
0
8674
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
8603
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
9157
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
9027
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...
0
7725
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
6518
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
4369
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...
2
2329
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.