Вот код, который обещал:
| Код | <html>
<head> <meta http-equiv="Content-Language" content="en-us"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Новая страница 1</title> <script src="http://mochikit.com/MochiKit/MochiKit.js"></script> <script type=text/javascript>
A1=Array() Count_a=2 A1[0]=[1,'2'] A1[1]=[2,'2']
j=1 function f1() { j=j+1 s1=SELECT({name:'select_'+j, id:'select_'+j}, OPTION({value:A1[0][0]}, A1[0][1])) for (c1 in A1) {if (c1>0){s1.appendChild(OPTION({value:A1[c1][0]}, A1[c1][1]))}} Table_0=document.getElementById('table1') tr_=Table_0.insertRow(Table_0.rows.length) tr_.id='tr_'+j tr_.appendChild( TD({bgcolor:"#FFFFFF", id:'td_'+j}, INPUT({name:'input_'+j, id:'input_'+j},''))) tr_.appendChild(TD({bgcolor:"#FFFFFF"},s1)) tr_.appendChild(TD({bgcolor:"#FFFFFF", align:"right"}, BUTTON({name:'B1', id:'b1_'+j, onclick:"javascript: return removeL("+j+")"},'-'), INPUT({id:"input_id_"+j, name:"input_id_"+j, type:"hidden", value:"-1"},"-1") )) return false; }
// remove row function removeL(i) { Table_0=document.getElementById('table1'); tr_=document.getElementById('tr_'+i) Table_0.deleteRow(tr_.rowIndex); //j=j-1 return false; }
</script> </head>
<body>
<form method="POST" action="--WEBBOT-SELF--"> <table border="1" width="84%" id="table1"> <tr> <td><input type="submit" value="Send" name="B1"></td> <td width="221"><input type="reset" value="Reset" name="B2"></td> <td width="133"> </td> </tr> <tr> <td><input type="text" name="T1" size="20"></td> <td width="221"><select size="1" name="D1"> <option value="1">1</option> <option value="2">2</option> </select></td> <td width="133"><input type="button" value="+" name="B3" onclick="javascript: return f1();"></td> </tr> </table> </form>
</body>
</html>
|
на этой страничке библиотека mochikit загружается с http://mochikit.com/MochiKit/, но можно скачать http://mochikit.com/dist/MochiKit-1.3.1.zip на ПК и изменить | Код | <script src="http://mochikit.com/MochiKit/MochiKit.js"></script> |
на путь на ПК. |