how to send a value upon clicking on drop down menu?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
vidyabhushan
Forum Newbie
Posts: 16
Joined: Mon Oct 20, 2008 4:58 pm

how to send a value upon clicking on drop down menu?

Post by vidyabhushan »

i have created a drop down menu. Now what i want to do is upon clicking on one of the value in the menu and submit the form along with that selected value i want to send one more value along with that.....
here is my code.....

Code: Select all

 
<?
$qry = "select test_id, user_id from QDescr_4Eval";
    $result = mysql_query($qry);
?>
<form action = "evaluation_page_exec.php" method = "post">
    <div align = "center"><table>
    <th></th>
    <tr>
    <h2>Tests available for Evaluation</h2>
    <td>
    <select name="test_id" id="Test" class="" tabindex="14"><option value = "">(Test_id), (User_id)</option>
<?
    while($row = mysql_fetch_row($result)) {
        if($t_id == $row[0] && $u_id == $row[1]) {
            ;
        }
        else {
            echo "<option value = $row[0] >$row[0], $row[1]"; 
            
            $t_id = $row[0];
            $u_id = $row[1];
        }
        
    }
?>
    </select>
    </td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
    <td>
    <input type = 'submit' name = 'submit' value = 'Submit'></input>
    </td>
    </tr>
    </form>
    </table></div>
 
As and when i click on a particular test_id the corresponding user_id also should be sent to the evaluation_page_exec.php page.... how to send two value with one option clicked....
Post Reply