473,769 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to keep the data in the form fields visible after the submit button is pressed

I have the following form the user enters the From and to period and
presses the Submit button and the form fields are cleared once the
submit button is pressed.

Is there a way I can keep the Form fields visible and not cleared.

Also when I display the message I want the original form cleared in a
different version of this page how can I clear the form completely when
I display the data entered from the Response statements I do not want
the form fields or the submit button visible anymore just the response
statements.

Your help is deeply appreciated.

Thanks
Karen

<html>
<body>
<form method="post" action="pForm.a sp">
From Period : <input type="text" name="FromPerio d"><br>

To Period : <input type="text" name="ToPeriod" >
<input type="submit" value="Submit" action = "Go">
</form>
<%
'// Check the first field only (assumes it is required)
If Request.Form("F romPeriod") <> "" Then
Response.Write "From: " & Request.Form("F romPeriod") & "<br>"
Response.Write "To: " & Request.Form("T oPeriod")
End If
%>
</body>

Oct 1 '05 #1
4 9904
The easy way to redisplay form values is to just do <input name="x"
value="<%=Reque st.Form("x")%>" />

<%
Dim bShowForm : bShowForm = True

''put your code here that would decide if the form should be shown or not.
''If it shouldn't be, set bShowForm to false.

'' What's action="go"?
%>

<html>
<body>
<% If bShowForm Then %>
<form method="post" action="pForm.a sp">
From Period : <input type="text" name="FromPerio d"
value="<%=Serv er.HtmlEncode(R equest.Form("Fr omPeriod"))%>"> <br> To Period : <input type="text" name="ToPeriod"
value="<%=Serve r.HtmlEncode(Re quest.Form("ToP eriod"))%>">>
<input type="submit" value="Submit" action = "Go">
</form>
<% End If %>
<%
'// Check the first field only (assumes it is required)
If Request.Form("F romPeriod") <> "" Then
Response.Write "From: " & Request.Form("F romPeriod") & "<br>"
Response.Write "To: " & Request.Form("T oPeriod")
End If
%>
</body>

Ray at home
<ka***********@ yahoo.com> wrote in message
news:11******** *************@o 13g2000cwo.goog legroups.com...I have the following form the user enters the From and to period and
presses the Submit button and the form fields are cleared once the
submit button is pressed.

Is there a way I can keep the Form fields visible and not cleared.

Also when I display the message I want the original form cleared in a
different version of this page how can I clear the form completely when
I display the data entered from the Response statements I do not want
the form fields or the submit button visible anymore just the response
statements.

Your help is deeply appreciated.

Thanks
Karen

<html>
<body>
<form method="post" action="pForm.a sp">
From Period : <input type="text" name="FromPerio d"><br>

To Period : <input type="text" name="ToPeriod" >
<input type="submit" value="Submit" action = "Go">
</form>
<%
'// Check the first field only (assumes it is required)
If Request.Form("F romPeriod") <> "" Then
Response.Write "From: " & Request.Form("F romPeriod") & "<br>"
Response.Write "To: " & Request.Form("T oPeriod")
End If
%>
</body>

Oct 1 '05 #2
Many Thanks Ray

Karen

Oct 2 '05 #3
Hi Ray

Sorry, another clarification when I set
Dim bShowForm : bShowForm = False

even the form fields disappear for the first time.

Can I dynamically have a button when the user presses it the form
fields can be cleared of
the page and when it is pressed again the form fields appears again.

Thanks
Karen

Oct 3 '05 #4
Sure, maybe something like.
<%
Dim bShowForm
bShowForm = CBool(Request.Q uerystring("sho wform"))
%>
<a href="thispage. asp?showform=<% =Abs(CInt(Not bShowForm))%>"> click</a>

<% If bShowForm Then %>
put form here
<% End If %>
Or just do it with javascript.

Ray at work

p.s. Not posted to
microsoft.publi c.inetserver.as p,microsoft.pub lic.inetserver. asp.db,microsof t.public.inetse rver.asp.faq
http://www.aspfaq.com/5004

<ka***********@ yahoo.com> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.com.. .
Hi Ray

Sorry, another clarification when I set
Dim bShowForm : bShowForm = False

even the form fields disappear for the first time.

Can I dynamically have a button when the user presses it the form
fields can be cleared of
the page and when it is pressed again the form fields appears again.

Thanks
Karen

Oct 4 '05 #5

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

Similar topics

7
2779
by: M | last post by:
i have a form which i would like to input different "action" url depending on the button that was clicked. is there a way that javascript can prefill a defined action based on the button pressed? thanks!!!
6
8599
by: millw0rm | last post by:
i got a form full of radio buttons appx. 60-70, depends on the page. Some times 60, sometimes 55.... After certain period of time, i want to disable or make readonly all the radio button inside the form except submit button. i have done the timing part, i hav setup a running clock which will trigger the event @ XX amount of time but i m unable to make the radio button disable or read only! remember submit button shld be available to...
3
9245
by: nkoriginal | last post by:
Hello: I tried an script for keep my data form after reload page, but I've some errors. In this momento I runnung my own browser because we've an intranet. And for security reason, our page reload every 10 minutes for keep my login live. But, we've some forms, and 10 minutes is a shorcut time to do that, and very 10 minutos, our page reload, and we lose all data in form (before submit). So, for that reason , I want to keep my data after...
7
1481
kvijayhari
by: kvijayhari | last post by:
hi i'm having a form in which a text field has a js function which lists the name of the customer by searching the letters typed in the field.. (like the one on gmail mail to column) The js funtion is working well and there's no problem until i activated the store data options in the browser. Once i use the forms the data entered before in the form fields are stored by the browser and they are gets listed over the div that is listed by...
4
6296
by: billa856 | last post by:
Hi, My project is in MS Access. In that I have one Form(DataEntry) which I am using for entering data into the Table(PRODUCTION). Now after entering data in Textboxes when I click on Button(Submit) then it add data to my table. Now I want that, When I click on Submit Button at that time first it add data to table and after that refresh the Form also at the same time.So I can add new data. I know this is possible but I don't know how to do...
4
2703
by: raknin | last post by:
Hi, I have a list that I want every time the list is changed I want to change other elemnets in the form automatically without pressing any submit button, for example an update second list. All this will be done with PHP and Javascript. Is it possible?
1
2250
by: arggg | last post by:
I created a submit form that calls a javascript:AjAX Command that will call the data and submit it without have the page refresh. This works perfect in Firefox however in IE and Opera when the submit button is pressed it just disables the button and does not submit the data. Any idea? <script type="text/javascript" src="<?=$config->getKey('Site_URL')."js/AJAX.js"?>"></script> <form name="EditUser" method="post" accept="text/plain"...
5
10147
oranoos3000
by: oranoos3000 | last post by:
hi I want to send value of textbox without using form tag and submit button to another page? Is it possible with php ? How do I get this thing work? thanks alot
4
3679
by: velocity00723 | last post by:
I am trying to login for website with autologin to forum,and vcalender its work fine in mozilla and ie but it gives problem in safari(IN MAC) following is the code if(isset($_POST)) { //echo "<pre/>";
0
10045
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
9863
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8870
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
7408
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
6673
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
5298
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...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3958
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
3561
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.