function novo_arquivo(){ var table = document.getElementById("tab_arquivo"); var nextRow = table.rows.length; var newRow = table.insertRow(table.rows.length); newRow.className ="tdlin"; newCell = newRow.insertCell(0); newCell.align = "center"; newCell.className = "grid_cab"; newCell. innerHTML = '<select size="1" class=caixa_texto id="ftipo_arq" name="ftipo_arq">'; }
Porém, esse campo "ftipo_arq" que está sendo chamado, é um listbox, que eu programei em php para que todas as informações da tabela referente a ele apareçam no listbox, mas quando eu adiciono essa linha, o listbox vem vazio.
Aqui está o sql que chama as informações do listbox:
echo ('<TD align=center class=grid_cab width="5%"><select size="1" class=caixa_texto id="ftipo_arq" name="ftipo_arq">'); $sql = 'select * from tger_dados_tipo_arq'; $result = $db->sql_query($sql); $b_entrou = false; while($row = $db->sql_fetchrow($result)) { if($ftipo_arq == $row['id']) { $b_entrou = true; echo '<option value="'.$row['id'].'" selected>'.$row['descricao'].'</option>'; } else { echo '<option value="'.$row['id'].'">'.$row['descricao'].'</option>'; } } if (!$b_entrou) { echo '<OPTION value="" selected>Selecione</OPTION>'; } echo ('</SELECT></td>');
O que eu quero é chamar uma nova linha onde o listbox apareça com todas as suas informações, independente da quantidade de linhas.
Obrigada!