473,396 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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=$_SESSION['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 2378
TG
Got it working... Disregard.
"TG" <tg********@cox.net> wrote in message
news:TeNKb.28275$JD6.12657@lakeread04...
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=$_SESSION['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.net | forum.digiserv.net
Programming, Web design, development & hosting.

Jul 17 '05 #3
I noticed that Message-ID:
<pa****************************@hybris.digiserv.ne t> 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($choices); $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
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...
8
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,...
6
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...
2
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...
10
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...
24
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...
8
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,...
3
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...
0
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
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,...

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.