openwin(obj)---obj是openwin的一个参数名称,可以用其他字符来写,如a,b,str,...都可以,只要符合变量的命名方式
openwin(this)---这里是调用函数,this是参数的值,获取到的是双击的这个文本框
函数里用到obj.id就是这个文本框的id值
	
	
			openwin(this)---这里是调用函数,this是参数的值,获取到的是双击的这个文本框
函数里用到obj.id就是这个文本框的id值

----我怎能在别人的苦难面前转过脸去----

 2011-09-28 14:44
	    2011-09-28 14:44
   2011-09-28 21:09
	    2011-09-28 21:09
   程序代码:
程序代码:<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="toptable grid">
      <form action="" method="post" name="form1">
      <tr>
        <td width="20%" height="30" align="right" bgcolor="#EEF7FD">选择:</td>
        <td width="80%" bgcolor="#EEF7FD" class="category">
<div id="d">料号:
  <input name="liao_hao" type="text" id="liao_hao0" ondblclick="openwin(this)" style="width:120px" value="双击选择料号"/>
  数量
  :  <input name="dan_jia0" id="dan_jia" type="text" style="width:60px" ondblclick="openwin(this)"  />
        </div>
        <input name="button" type="button" id="b" value="添加"/>     
</td>
      </tr>
     
      <tr>
        <td height="30" colspan="2" align="center" bgcolor="#EEF7FD"><label></label>
          <input name="submit" type = "submit" class="button" id="up" onclick="return on_up();;" value = "提交"/>  </td>
      </tr>
      </form>
</table> 
<script language="javascript">
i = 1;
document.getElementById("b").onclick=function(){
  document.getElementById("d").innerHTML+='<div id="div_'+i+'">料号: <input name="liao_hao" id="liao_hao'+i+'" type="text" style="width:120px"  ondblclick="openwin(this)" value="双击选择料号"  /> 数量 : <input name="dan_jia" id="dan_jia_'+i+'" type="text" style="width:60px"/><input type="button" value="删除"  onclick="del('+i+')"/></div>';
  i = i + 1;
}
//===================================================================
//下面是 写的 检查 料号不能为空的 功能但是不成功  还请 指教!
function on_up()
{
    var liao_hao=document.getElementsByName("liao_hao");
    //获取所有name="liao_hao"的元素
    for (var i=0; i<liao_hao.length; i++){
        if (liao_hao[i].value=="双击选择料号" || liao_hao[i].value=="")
        {
            alert("第"+(i+1)+"行 料号不能为空");    //这里的行是顺序行,不是id值
            return  false;  
        }
    }
}
//=========================================================================
function del(o){
    document.getElementById("d").removeChild(document.getElementById("div_"+o));
  document.form1.max_mumber.value=i-1
}
       </script>
<script LANGUAGE="JavaScript">
function openwin(obj) {
    window.open ("add_list.asp?liaohao_id="+obj.id+"", "newwindow", "height=400, width=780, toolbar =no, menubar=no,top=180,left=190,  scrollbars=yes, resizable=no, location=no, status=no") //写成一行
   }
</script>										
					
	
 2011-09-29 10:38
	    2011-09-29 10:38