Hi, New at Javascript and have done a bit of playing around trying to figure out a answer but cant figure it out. Hopefully someone can help.

have a Dropdown box (TYPE) that needs to populate a calculation in another form box (VALUE) and submit to database once submit is clicked.

Code I have:

Code:
<p>NUMBER</p>
            <input name="contact_build" type="text" id="contact_build" value="<?php echo $row_contact['contact_build']; ?>" />
         
   
<p>TYPE</p>
            <select id="contact_type" name="contact_type" />
<?php $specresult = mysql_query("SELECT * FROM `types` ORDER BY type_value");
while($specrow = mysql_fetch_array($specresult)){
			echo '<option value="'.$specrow['type_name'].'">'.$specrow['type_name'].'</option>'; } ?>
</select>

        
    

<p>VALUE</p>
    <?php 
      $var1 = $row_contact['contact_build']; 
      $var2 = $row_value['type_value']; 
      $total = round ($var2 *  $var1); 
      echo "" . $total . ""; 
    ?>" />
<input name="contact_value" value="<?php $var1 = $row_contact['contact_build']; $var2 = $row_value['type_value']; $total = round ($var2 *  $var1); echo "" . $total . ""; ?>" />
        

        <input type="submit" name="Submit2" value="Update" />

So what I want to happen is: when user selects item from "TYPE" is changes the value in "VALUE" Box by the calculation to show the new figure before submit is clicked and without refreshing the page to save the new figures to the database. The second box cannot be changed by the user. I have played with JScripts and stuff but cant get it to work. I have only supplied the code Prior to J Script as I think I made a real mess of it.

Also I know It is Mysql at present. I am just finalising learning PDO at the moment and AM GOING to be using PDO in the future. :-) But just want to get this sorted using the code I know at present, then I can change over to PDO.

Please let me know if more info is needed.

Thanks for your help :-)