Re: Sticky Forms
| From: | Tim Sawyer | Date: | Sat, 21 Oct 2000 03:47:15 +0000 |
| Subject: | Re: Sticky Forms | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-21523@lists.php.net to get a copy of this message | ||
Steve,
I ended up making a <select> sticky this way. It's crass but it works. Let me
now if you know of a more elegant solution.
Company:
<select name="selvar[company]">
<option value="%" <?php if ($selvar[company] == "%") { echo
"selected";
} ?> > IBM & Verizon
<option value="IBM" <?php if ($selvar[company] == "IBM") { echo
"selected";
} ?> > IBM
<option value="GTE" <?php if ($selvar[company] == "GTE") { echo
"selected";
} ?> > Verizon
</select>
Steve Lawson wrote:
> just echo the variables into the correct fields.
>
> <INPUT TYPE="text" NAME="f_msg" VALUE="<?php echo $f_msg;
> ?>">
>
> When the page is generated the field will be blank because $f_msg will be
> undefined. However, once you submit this page it will place the value back
> into the field.
>
> SL.
>
> ----- Original Message -----
> From: "Tim Sawyer" <tsawyer@socal.rr.com>
> To: "PHP-GENERAL" <php-general@lists.php.net>
> Sent: Friday, October 20, 2000 7:24 PM
> Subject: [PHP] Sticky Forms
>
> > How do I make forms "sticky" like CGI.pm does? That is, I want a
> > selection form element (or text, or whatever) to have the keep it's
> > value when I press back or call the form itself. I'm brand new to PHP
> > but I've been using CGI.pm for a while. Thanks for hehping me get
> > started. Spent a couple of hours with the docks but can't find if PHP
> > can do this.
> >
> > --
> > Tim Sawyer
> > :wq
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
> >
--
Tim Sawyer
:wq