Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I am developing a form that allows the user to enter data and upon
submission, checks various databases, returns the data to the user so
they can confirm before submission to the database.

Two of the fields are employee names which are retrieved via a call to
the db:

<TD>Assign Rep/Mfg Hours To</TD>
while ($myrow = mysql_fetch_array($emplist1)){
$arht=$myrow['lname'].", ".$myrow['fname'];
echo "<OPTION VALUE=$arht>$arht</OPTION>";
} ?>

As you can see, the field is built by concactinating the lname and
fname fields.

Once the FIRST submission button is clicked, I redisplay the form with
the values the user entered and the returned values from various db
searches that are performed.

I display the above selection by:

<TD>Assign Rep/Mfg Hours To</TD>
<TD><INPUT TYPE=TEXT NAME=arht VALUE="<? echo $arht ?>"></TD>
<TD>Est. Project Set Up Time</TD><TD><INPUT TYPE=TEXT NAME=epsut
VALUE="<? echo $epsut ?>"></TD>

Only problem is that I only see the 'lname' and the comma. The fname
field is not displayed. I can't seem to find where the problem is or
what I am doing wrong. Anyone see the obvious that I am not?


Re: Using SELECT

redneck_kiwi wrote:
Quoted text here. Click to load it

echo '<OPTION VALUE="', url_encode($arht), '">',
     $arht, '</OPTION>';


echo "<OPTION VALUE='$arht'>$arht</OPTION>";
// _________________^_____^___

but I like the first version better :)

Quoted text here. Click to load it

USENET would be a better place if everybody read:   | to email me: use |   | my name in "To:" |     | header, textonly |                    | no attachments.  |

Re: Using SELECT

Thanks! Both work, however using urlencode (you had an underscore) gave
me fname%2C+lname in the input field on the confirmation page. Guess
I'd have to urldecode on the display side to correct that!
Enclosing ('$arht') did the trick though!



Re: Using SELECT

redneck_kiwi wrote:

Quoted text here. Click to load it

In your first code snippet you haven't quoted $ahrt in
<option value=$ahrt>

Site Timeline