php - How do you echo out radio input types? -


i have html form echos text , radio inputs. form waits values filled before echoing them out.

here example of text input:

<input type='text' name='occ3' size='20' value="<?php echo $occ3; ?>"/> 

here radio output:

<input type='radio' name='o2' value='yes'>yes <input type='radio' name='o2' value='no'>no 

how output selected radio after user submits information? please help

if want radio buttons default submitted, can do:

$o2 = $_request['o2']; ?> <input type='radio' name='o2' value='yes' <?php if($o2 == 'yes') echo 'checked' ?> >yes <input type='radio' name='o2' value='no' <?php if($o2 == 'no') echo 'checked' ?> >no 

Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -