这个应该去JavaScript里去问在size的onChange事件里把Price的值变一下就行了

解决方案 »

  1.   

    1  <select name="size" onchange="document.all.price.value=this.value">
    <?    
          $sql = "SELECT * FROM Tphotoprice  where shop_id='$shopid'  order by size ";
     $result = mysql_query($sql) or die(mysql_error());
     $num = mysql_num_rows($result);
     if($num > 0)  {
      while($row = mysql_fetch_array($result)) {
                 ?>
                                    <option value="<? echo $row['size'];?>"><? echo $row['size'];?></option><?}?>
                                    </select>
                                       2  <input name="price" type="text" id="price"  value="" readonly>
      

  2.   

    加上,有很多产品,size 和price是对应每一个商品
    就是:产品1 size price;
          产品2s ize price;
    我不知道是不是有关系。
      

  3.   

    <select name="size" onchange="price.value=this.options[this.selectedIndex].price">
    <?    
    $sql = "SELECT * FROM Tphotoprice  where shop_id='$shopid'  order by size ";
    $result = mysql_query($sql) or die(mysql_error());
    $num = mysql_num_rows($result);
    if($num > 0)  {
        while($row = mysql_fetch_array($result)) {
    ?>
    <option value="<? echo $row['size'];?>" price="<?echo $row['price'];?>">
    <? echo $row['size'];?>
    </option>
    <?}?>
    </select>
    <input name="price" type="text" id='price' readOnly>