通过下拉列表选择头像时应用该函数

2009-11-28 14:33:31 by 【6yang】, 104 visits, 收藏 | 返回

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>

<body>
<table width="106" cellpadding="0" cellspacing="0">
<form  name="myform" action="register_deal.php" method="post">
                  <tr>
                    <td width="10" height="47">
     <script language="javascript">
      //通过下拉列表选择头像时应用该函数
      function showlogo(){
      document.images.img.src=" images/head/"+document.myform.txt_ico.options[document.myform.txt_ico.selectedIndex].value;
      }
              </script>
     </td>
                    <td width="80"><img src=" images/head/0.gif" name="img" width="60" height="60"></td>
                    <td width="53" rowspan="2" align="center"><font color=red>*</font></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td> <select name="txt_ico" size="1" id="txt_ico" onChange="showlogo()">
                        <option value="0.gif" selected>头像1
                        <option value="1.gif">头像2
                        <option value="2.gif">头像3
                        <option value="3.gif">头像4</option>
                        <option value="4.gif">头像5</option>
                        <option value="5.gif">头像6</option>
                      </select> </td>
                  </tr> </form>
              </table>
</body>
</html>

分享到:
share

    图片原图

    loading

    loading