473,788 Members | 2,784 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

POST blanks out form fields

TG
I have a form that POSTs to itself and validates data entered into the form.
If all is well the form performs a header location command to move to the
next input form in the series. If the user has entered an error within the
form the user is NOT redirected to the next page and error messages are
displayed indicating the fields that are in error. So far so good. The only
problem is that all the input fields are now blanked out after the post.
These fields must display all the values that were inputted before the post
was executed.

I have tried the following to no avail......

reassigning values like this after the post => $zip=$_POST['zip'];

reassigning values like this after the post =>
$fullname=$_SES SION['fullname'];

Utilizing this Meta Tag => <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="CACHE" >

None of these are working!

How can I keep the data that was entered into the form fields before the
post was executed?

Thanks!
Jul 17 '05 #1
3 2392
TG
Got it working... Disregard.
"TG" <tg********@cox .net> wrote in message
news:TeNKb.2827 5$JD6.12657@lak eread04...
I have a form that POSTs to itself and validates data entered into the form. If all is well the form performs a header location command to move to the
next input form in the series. If the user has entered an error within the
form the user is NOT redirected to the next page and error messages are
displayed indicating the fields that are in error. So far so good. The only problem is that all the input fields are now blanked out after the post.
These fields must display all the values that were inputted before the post was executed.

I have tried the following to no avail......

reassigning values like this after the post => $zip=$_POST['zip'];

reassigning values like this after the post =>
$fullname=$_SES SION['fullname'];

Utilizing this Meta Tag => <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="CACHE" >
None of these are working!

How can I keep the data that was entered into the form fields before the
post was executed?

Thanks!

Jul 17 '05 #2
On Wed, 07 Jan 2004 00:04:10 -0800, TG wrote:
I have a form that POSTs to itself and validates data entered into the
form. If all is well the form performs a header location command to move
to the next input form in the series. If the user has entered an error
within the form the user is NOT redirected to the next page and error
messages are displayed indicating the fields that are in error. So far so
good. The only problem is that all the input fields are now blanked out
after the post. These fields must display all the values that were
inputted before the post was executed.

So fill them in!

You need to look at the 'value' element in the form.

Regards,

Ian

--
Ian.H [Design & Development]
digiServ Network - Web solutions
www.digiserv.net | irc.digiserv.ne t | forum.digiserv. net
Programming, Web design, development & hosting.

Jul 17 '05 #3
I noticed that Message-ID:
<pa************ *************** *@hybris.digise rv.net> from Ian.H
contained the following:
The only problem is that all the input fields are now blanked out
after the post. These fields must display all the values that were
inputted before the post was executed.

So fill them in!

You need to look at the 'value' element in the form.


I know I could have asked for help, but I've spent aged trying to write
some nice code to make drop down boxes do this. Whilst trying to make
an easily changeable form, I managed to write the following. I'm quite
pleased with it.

<?php
$choices[]="Choose one:";
$choices[]="Option one";
$choices[]="Option two";
$choices[]="Option three";
$choices[]="Another option";

if(!$_POST['chooser']){
$a[0]=" selected";
}
print"<select name=\"chooser\ ">\n";
for($i=0; $i<count($choic es); $i++){
if($_POST['chooser']==$choices[$i]){
$a[$i]=" selected";
}
print "<option$a[$i]>$choices[$i]</option>\n";
}
print"</select>";
?>

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #4

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

Similar topics

3
2517
by: Robert | last post by:
Hello, Can anyone help with this? On my online order form, I need to send a few variables to my credit-card processor. These variables are for non-secure customer comments, and will be sent through the usual metod, i.e., <form action="https://orderpage.ic3.com/hop/orderform.jsp" method="post">
8
5095
by: dmcconkey | last post by:
Hi folks, I have a client with four websites. Each site has a contact form that is identical. They all have "required" fields validated through a JavaScript onSubmit() function. Upon validation, post values go to a PHP processing page that adds values to a database and generates an email to someone in marketing. For three of these sites, we have no problem, but the fourth keeps sending in blank forms.
6
5875
by: Pete Mahoney | last post by:
I am trying to 'POST' values from a form in a ASP file that has anonymous access permissions. I can retrieve the form values when I redirect to this page from another page which has also has anonymous access permissions. However, if I change the page from which I'm redirecting to use NT authentication, then I cannot retrieve the values of the form fields using POST method. Specifically, if the following file (MyStart.asp) has anonymous
2
2744
by: John Hoge | last post by:
I have a regex "^\d{5}$" that does not allow blanks, but the RegularExpressionValidator does not fire for empty fields. Is there a way to make it do so? I would rather not include a separate RequiredValidator for reasons of brevity and neatness. Thanks, John
10
3441
by: glenn | last post by:
I am use to programming in php and the way session and post vars are past from fields on one page through to the post page automatically where I can get to their values easily to write to a database or continue to process on to the next page. I am now trying to learn ASP to see if we can replace some of our applications that were written in php with an ASP alternative. However, after doing many searches on google and reading a couple...
24
2884
by: moriman | last post by:
Hi, The script below *used* to work. I have only just set up a server, PHP etc again on my Win98 system and now it doesn't? On first loading this page, you would have $p = and the button image below it.
8
2976
by: cwhite | last post by:
i want to create a form where the user can choose from a list of names in table A associated with this name is a telephone and address on the form there will be a drop list for the name, fields for address and telephone and a comment section i would like the form to fill in the address and telephone automatically once the name is chosen, (the only field the user can
3
2340
by: Bill | last post by:
I'm using the POST method to submit a simple form html page with yes/no and checkbox fields to an asp response page which stores the values in a new dim string, then uses it to build a new table using ADO. I'm getting sometimes correct values, sometimes null values (when I know I pass a valid default value) and other times multiple values! I know what the values coming over are because I do a response.write to see it before the error...
0
1400
by: kamimeer | last post by:
I am using .net 2.0 and WebBrowser control that comes with it in C#.I am having some issue trying to do a POST action on a Web URL. I have a site that has two input fields in it, but when I try to submit a request using the following code , nothing happens and the site just show up with the User Name and Password fields being blanks. public void SetURL(string url) {
0
9656
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
9498
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
10373
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
10177
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...
1
10118
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
8995
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
7519
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
6750
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
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.