php - How to use Radio button? -
how can use radio button correctly?
i have questions on our evaluation instructor , store on database called tbl_question. call question , it, assign radio button on side rate 5 always, 4 , etc.. must have 1 answer each question. problem can select 1 value in question. if radio 5 answer question 1 if answer 5 in question 2 in question 1 answer not selected instead transfer question 2. if answer 5 in question one. can answer 4 in question one.
<?php include('connection.php'); $qry="select * tbl_question"; $res=mysql_query($qry) or die(mysql_error()); $nr= mysql_num_rows($res); ?> ` <table align="center" border="1" cellspace="10" style="width:700px text-align:center border-collapse:collapse border:1px solid black"> <tr> <th>questions</th> <th>always<br><img src="5.png" width="50" height="40"/></th> <th>often<br><img src="4.png" width="50" height="40"/></th> <th>sometimes<br><img src="3.png" width="50" height="40"/></th> <th>seldom<br><img src="2.png" width="50" height="40"/></th> <th>never<br><img src="1.png" width="50" height="40"/></th> </tr> <?php while ($rows=mysql_fetch_array($res)){ ?> <tr> <td> <?php echo '<strong>'. $rows['eval_question']. '</strong>'; ?> </td> <td> <input type="radio" name="5" value="5"> </td> <td> <input type="radio" name="4" value="4"> </td> <td> <input type="radio" name="3" value="3"> </td> <td> <input type="radio" name="2" value="2"> </td> <td> <input type="radio" name="1" value="1"> </td> </tr>
read little bit on how create <div id="[div_id]">
s.
you able show or hide parts of lists wrapping them in <div>
tags, , using javascript function make them visible or not. code looks this:
document.getelementbyid("[div_id]".style.display = "block" //visisble document.getelementbyid("[div_id]".style.display = "none" //not visible
the contents of entire form passed once form submitted regardless of state of <div>
.
here better code example.
Comments
Post a Comment