I have two select boxes they are drop downs I want the first select box too change the second one based on is selection. It works great but the problem is that the first drop down value that I assigned is not the value that I want.
This is my table setup
my first table name is "calltypecode."
the fields for the this table is
some example data
description and priority
description = fire one
priority = regular
description = fire two
priority = silent

my second table name is "prioritytype".
my second table only has field priority
priority = regular
priority = silent

They booth have something in commend but for the first drop down box I want the value to be description not the value priority I already have that value in the other drop down box.

I pretty much give up. Does anyone now how to do what I want.

This code works great but the value that I want is this variable to post $description
this is my code for javascript
Code:
window.onload = function() { BindEvent(); }

    function BindEvent()
    {
       
        var elemToBind = document.getElementById ( "maintype" );
        elemToBind.onchange = function () { SetSel ( this ); }
    }
    function SetSel(elem)
    {
       
        var secondCombo = document.getElementById ( "priority" );
        secondCombo.value = elem.value;   
    }
this is the code for the first select box
Code:
<select class="type" id="maintype"  name="maintype" selected="selected" onchange="showhide(this)">
	<option value=0 selected="selected"></option>
<?php
	while($fetchdrop = mysqli_fetch_array($executedrop))
	{
		$description = $fetchdrop['description'];
		$priority = $fetchdrop['priority'];
		 echo "<option id= 1 value='$priority'>". $description . "</option>";
	}
	mysqli_close($cnx);
?>
</select>
I am optaining information from a database.

This is my other select drop down box
Code:
<select class="priority" id="priority">
	<option value=0></option>
<?php
	include "connection.php";
	$sqlpriority = mysqli_query($cnx, "SELECT * FROM prioritytype");
	while($fetch2 = mysqli_fetch_array($sqlpriority))
	{
		$priority = $fetch2['priority'];
		echo "<option value='$priority'>" . $priority . "</option>";
	}
?>
</select>