By 'sticky field', I assume you mean that the User's input is saved between page loads (so, for example, he doesn't lose any input if you need to report an error or a validation warning).
Smarty is pretty good at this, but it's probably too late in the app's development cycle to try to start implementing a template system.
It's somewhat difficult with selects and checkboxes, but for text inputs, it's pretty easy to keep track of the value.
First thing you'll probably want to do is save the [VALIDATED!] input to the User's session.
Something like this (I'm pulling relevant code from my frameworks and trying to simplify it for the context; bear with me):
[PHP]
// Set up default values.
if(! isset($_SESSION['REQUEST']))
$_SESSION['REQUEST'] = array(
'flavor' => 'Brownie Batter',
'color' => 'purple',
etc.
);
$blacklist = array(
'PHPSESSID' => true,
'USERNAME' => true,
'PASSWORD' => true,
'LOGOUT' => true
);
// Overwrite $_SESSION['REQUEST'] with NEW values only.
$_SESSION['REQUEST'] = array_merge(
$_SESSION['REQUEST'],
validate(array_diff_key($_REQUEST, $blacklist))
);
[/PHP]
Note that 'validate' is a placeholder; replace it with your favorite validation function or object.
Now that you've got a persistent $_SESSION['REQUEST'], you can output it fairly easily.
[HTML]
<input name="flavor" type="text" value="<?php echo $_SESSION['REQUEST']['flavor']; ?>" />
<select name="color"><?php
foreach($colorSet as $val => $txt)
echo "<option value=\"$val\"" . (($_SESSION['REQUEST']['color'] == $val)
? ' selected="selected"'
: ''
) . ">$txt</option>";
?></select>
[/HTML]
And so forth.