2
I’m having trouble taking the data from the database and passing via Session to my form, all the input data is coming correctly, I just can’t pass it as check
for my radios... I tested in various ways, one of them was:
<div class='row'>
<div class='col-lg-9'>
<div class='radio'>
<label for='fisica'>
<input type='radio' tabindex="1" class="tipo_pessoa" checked="checked" name='tipo_pessoa' id='fisica' value='fisica' />Pessoa Física</label>
</div>
<div class='radio'>
<label for='juridica'>
<input type='radio' tabindex="2" class="tipo_pessoa" name='tipo_pessoa' id='juridica' value='juridica' />Pessoa Jurídica</label>
</div>
</div>
</div>
<?
$value=$row['tipo_pessoa'];
$checked1=($value=="fisica")?'checked':'';
$checked2=($value=="juridica")?'checked':'';
?>
<input type="radio" name="tipo_pessoa" value="fisica" <?php echo $checked1; ?> />
Fisica
<input type="radio" name="tipo_pessoa" value="juridica" <?php echo $checked2; ?> />
Juridica
The browser interprets the same result for the two types of syntax . <input type="radio" checked="<? php echo $checked1; ? >" /> OR <input type="radio" checked /> If there is any difference, please explain to me
– LucaoA
is having the same problem as before... it is always checked only in legal even when the user is as a physical person
– Benhur Külzer