POST blanks out form fields

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • TG

    POST blanks out form fields

    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!


  • TG

    #2
    Re: POST blanks out form fields

    Got it working... Disregard.


    "TG" <tgillette1@cox .net> wrote in message
    news:TeNKb.2827 5$JD6.12657@lak eread04...[color=blue]
    > I have a form that POSTs to itself and validates data entered into the[/color]
    form.[color=blue]
    > 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[/color]
    only[color=blue]
    > 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[/color]
    post[color=blue]
    > 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"[/color]
    CONTENT="CACHE" >[color=blue]
    >
    > None of these are working!
    >
    > How can I keep the data that was entered into the form fields before the
    > post was executed?
    >
    > Thanks!
    >
    >[/color]


    Comment

    • Ian.H

      #3
      Re: POST blanks out form fields

      On Wed, 07 Jan 2004 00:04:10 -0800, TG wrote:
      [color=blue]
      > 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.[/color]


      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.

      Comment

      • Geoff Berrow

        #4
        Re: POST blanks out form fields

        I noticed that Message-ID:
        <pan.2004.01.07 .13.16.40.52644 1@hybris.digise rv.net> from Ian.H
        contained the following:
        [color=blue][color=green]
        >>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.[/color]
        >
        >
        >So fill them in!
        >
        >You need to look at the 'value' element in the form.[/color]

        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/

        Comment

        Working...