Welcome Guest, Not a member yet? Register   Sign In
Validating a Form - How to set values on Dropdown Boxes?
#1

[eluser]Sinclair[/eluser]
Hi,

I'am validating a form and I need to set_value on a <select>. I'am able to set the value, but I need also to show the text that is different from the value set.

The code is:
Code:
<p>
          <label for="name">G&eacute;nero: </label>
        <select name="genero">
        <option></option>
        &lt;?php foreach ($generos as $rowgeneros): ?&gt;
        <option value="&lt;?php echo set_value('genero', $rowgeneros->id_genero); ?&gt;">&lt;?php echo $rowgeneros->n_genero; ?&gt;</option>
        &lt;?php endforeach; ?&gt;
        </select>
      </p>

Wich is the best option to show the value selected on "echo $rowgeneros->n_genero;"

Best Regards,


Messages In This Thread
Validating a Form - How to set values on Dropdown Boxes? - by El Forum - 03-06-2010, 07:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB