<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html style="direction: ltr;">
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
I want the cell in the table to be the form field ($form[myfield]),
which was declared previously as<br>
$form['myfield'][$id] = array (<br>
'#type'=> 'select',<br>
'#options' => $value_array,<br>
'#default_value' => $value[$id],<br>
);<br>
<br>
So now, using drupal_render($form[myfield]) in the table, I get the
select box, and it is populated with $value_array values, but its
initial presentation in every row is no value...the default value seems
to be ignored.<br>
<br>
On 09/02/2010 10:59 PM, nan wich wrote:
<blockquote cite="mid:302407.63996.qm@web180308.mail.gq1.yahoo.com"
type="cite">
<style type="text/css"><!-- DIV {margin:0px;} --></style>
<div style="font-family: arial,helvetica,sans-serif; font-size: 12pt;">
<div>$form[myfield] is an array. Assuming you only want the value
then use $form[myfield]['#value'] or $form[myfield]['#default_value'].<br>
</div>
<p><font face="bookman old style, new york, times, serif" size="4"
color="#ff007f"><em><strong>Nancy</strong></em></font><br>
</p>
<div style="font-size: 12pt; font-family: arial,helvetica,sans-serif;"><br>
<div style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"><font
face="Tahoma" size="2">
<hr size="1"><b><span style="font-weight: bold;">From:</span></b>
Jeff Greenberg <a class="moz-txt-link-rfc2396E" href="mailto:jeff@ayendesigns.com"><jeff@ayendesigns.com></a><br>
<b><span style="font-weight: bold;">To:</span></b>
<a class="moz-txt-link-abbreviated" href="mailto:development@drupal.org">development@drupal.org</a><br>
<b><span style="font-weight: bold;">Sent:</span></b> Thu, September
2, 2010 8:20:20 PM<br>
<b><span style="font-weight: bold;">Subject:</span></b> [development]
Form fields in a table<br>
</font><br>
Using FAPI for a form (D6), and in the form is a markup field, which is
a table created with theme(). Some of the cells in the table need to be
populated with form fields. The contents of the table is being sent to
theme() as $rows, and I've tried having the cells in question defined
as $form[myfield] that has been created earlier, but I end up with an
empty cell, and the form field appearing where it was first defined,
prior to the table... so...<br>
<br>
$form[myfield] = array(...<br>
<br>
<br>
$rows[this_row] = array(cellval, cell2val, $form[myfield] ...<br>
<br>
<br>
isn't working.<br>
<br>
<br>
I need something like<br>
<br>
<br>
Row 1 text text selectbox text
textfield text<br>
<br>
<br>
<br>
<br>
<br>
</div>
</div>
</div>
</blockquote>
</body>
</html>