下拉菜单啊写TEXT。。 这个应该去JavaScript里去问在size的onChange事件里把Price的值变一下就行了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 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> 加上,有很多产品,size 和price是对应每一个商品就是:产品1 size price; 产品2s ize price;我不知道是不是有关系。 <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> 关于openssl求大牛 如何实现某一行文字首页不显示但是内页显示 如何取得字符串中的关键字 分享一下 PHP学习步骤 超全局变量$G赋值问题 【如何删除mysql数据库中的重复数据?】 美女帅哥:怎样修改mysql中root的密码? smarty http 500错误 为什么 求一个算法! 用php发送mail问题 怎样得到两个datetime类型的变量之间相差的天数? 怎么取得用户离开是的时间啊?
<?
$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>
就是:产品1 size price;
产品2s ize 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>