<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000066">
John,<br>
<br>
I only used #value to test my array content!! I do not intent to use
both<br>
<br>
With #value, it shows up, when I change to #default_value, the
information is gone!!!<br>
<br>
its clear now? :)<br>
<br>
<br>
thanks!!<br>
Feijó<br>
<br>
John VanDyk escreveu:
<blockquote cite="mid:p06240803c3be5e3503ee@%5B129.186.236.39%5D"
type="cite">If #value is set, #default_value will be ineffective. From
form.inc:
<br>
<br>
if (!isset($form['#value'])) {
<br>
$function = $form['#type'] . '_value';
<br>
if (function_exists($function)) {
<br>
$function($form);
<br>
}
<br>
else {
<br>
$form['#value'] = isset($form['#default_value']) ?
$form['#default_value'] : '';
<br>
}
<br>
}
<br>
<br>
Because the form is built multiple times, this can be confusing.
<br>
<br>
<blockquote type="cite">I already try with print_r !
<br>
<br>
it shows the content "array(['name'] => 'name test')" in
#description and #value, but never on #default_value
<br>
<br>
The name field is varchar(50), with 'name test'. Just it.
<br>
<br>
Yesterday a PHP expert was here, he take a look at this, we try a lot
of possibilities, no clue whatsoever
<br>
<br>
It cant be explained :)
<br>
<br>
<br>
Jakob Petsovits escreveu:
<br>
<br>
<blockquote type="cite">On Thursday, 24. January 2008, Feijó wrote:
<br>
<br>
<br>
<blockquote type="cite"> If I try
<br>
'#default_value' => 'test ' . $row['name'],
<br>
<br>
only test apears!
<br>
<br>
</blockquote>
<br>
Imho, that behaviour suggests that something is wrong with $row['name']
and
<br>
less with Form API itself. (Because string concatenation fails even
before
<br>
the Form API gets the value passed over.)
<br>
<br>
Not sure, but maybe print_r($row) and/or gettype($row['name']) reveals
some
<br>
useful information...
<br>
<br>
</blockquote>
</blockquote>
<br>
</blockquote>
</body>
</html>