Tema: Checkbox
Ver Mensaje Individual
  #4 (permalink)  
Antiguo 06/07/2011, 14:45
ryke
 
Fecha de Ingreso: junio-2011
Mensajes: 11
Antigüedad: 12 años, 10 meses
Puntos: 0
Consulta checkbox, combo y radio...

Bueno para aquellos que tenian la duda igual que yo aqui dejo las respuestas

checkbox:

Código PHP:
                  <tr>
                            <th>1.1 Título de T.S.U.</th>
                            <th><input name="titulo" type="checkbox" value="16" <?php if($row2["titulo"] == 16) { ?>checked<?php ?> /></th>
                            </tr>
combo o select option:

Código PHP:
<tr>
                            <th>2.1 Antiguedad como Profesional T.S.U.</th>
                                    <th><select name="antiguedad">
                                    <option value="0" <?php if($row2["antiguedad"] == 0) { ?>selected<?php ?>>0</option>
                                      <option value="1" <?php if($row2["antiguedad"] == 1) { ?>selected<?php ?>>1</option>
                                    <option value="2" <?php if($row2["antiguedad"] == 2) { ?>selected<?php ?>>2</option>
                                    <option value="3" <?php if($row2["antiguedad"] == 3) { ?>selected<?php ?>>3</option>
                                    <option value="4" <?php if($row2["antiguedad"] == 4) { ?>selected<?php ?>>4</option>
                                    <option value="5" <?php if($row2["antiguedad"] == 5) { ?>selected<?php ?>>5</option>
                                    </select></th>                            
                          </tr>
radio:

Código PHP:
<tr>
                            <th>2.2 Record Alcanzado como Profesional T.S.U.</th>
                            <th>-</th>
                            <th>-</th>
                            <th>Max. 15</th>
                            </tr>
                        <tr>
                            <th>No Aplica</th>
                            <th>-</th>
                            <th><input type="radio" name="record" value="0" <?php if($row2["record"] == 0) { ?>checked<?php ?>/></th>
                         <th rowspan="6"></th>
                        </tr>
                        <tr>
                            <th>Grado 17-18</th>
                            <th>3</th>
                            <th><input type="radio" name="record" value="3" <?php if($row2["record"] == 3) { ?>checked<?php ?>/></th>
                        </tr>
                        <tr>
                            <th>Grado 19-20</th>
                            <th>6</th>
                            <th><input type="radio" name="record" value="6" <?php if($row2["record"] == 6) { ?>checked<?php ?>/></th>
                            </tr>
                        <tr>
                            <th>Grado 21-22</th>
                            <th>9</th>
                            <th><input type="radio" name="record" value="9" <?php if($row2["record"] == 9) { ?>checked<?php ?>/></th>
                            </tr>
                        <tr>
                            <th>Grado 23-24</th>
                            <th>12</th>
                            <th><input type="radio" name="record" value="12" <?php if($row2["record"] == 12) { ?>checked<?php ?>/></th>
                            </tr>
                        <tr>
                            <th>Grado 25 o más</th>
                            <th>15</th>
                            <th><input type="radio" name="record" value="15" <?php if($row2["record"] == 15) { ?>checked<?php ?>/></th>
                            </tr>
                        <tr>
Bueno es de suponer que saben que las etiquetas tr o th van dentro de un table y <?php if($row2["record"] == 15) { ?>checked<?php } ?> por ejemplo es la comparacion con la consulta a la base de datos