All pastes #434343 Raw Edit

Untitled

public text v1 · immutable
·published 2007-04-11 11:34 UTC
rendered paste body
<!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=utf-8" />
<title>Untitled Document</title>
</head>

<body>

    <table border="1">
	 <tr>
	  <td>
       <script language="javascript">
	    function add_form_el(){
         var f = document.getElementById("name_if_form");
         if(f!=null){
          var p = document.createElement("input");
          p.setAttribute("type", "text");
          p.setAttribute("name", "name");
	      p.setAttribute("value","hallo world");
          f.appendChild(p);
         };
		 
		 var tb=document.getElementById("if_form");
         var if_co=document.getElementById("if_co");
		 c=if_co.value;
		 alert(c);

		 var tr=document.createElement("tr");
        
		 var td1=document.createElement("td");
		 var td2=document.createElement("td");
		 var td3=document.createElement("td");
		 var td4=document.createElement("td");		 
		 
		 var inp_name=document.createElement("input");
		 var inp_ip=document.createElement("input");
         var inp_about=document.createElement("textarea");
         var inp_rel=document.createElement("select");

		 inp_rel.options[0]=new Option("test1","test1",false,false);
         td4.appendChild(inp_rel);

         inp_about.setAttribute('name','if_about_'+c);
         inp_about.setAttribute('title','&#1050;&#1086;&#1084;&#1084;&#1077;&#1085;&#1090;&#1072;&#1088;&#1080;&#1080;');		 
         td3.appendChild(inp_about);
		 
         inp_ip.setAttribute('name','if_ip_'+c);
         inp_ip.setAttribute('title','ip');		 
         td2.appendChild(inp_ip);

         inp_name.setAttribute('name','if_name_'+c);
         inp_name.setAttribute('title','&#1048;&#1084;&#1103;');		 


		 td1.appendChild(inp_name);

		 tr.appendChild(td1);
		 tr.appendChild(td2);
		 tr.appendChild(td3);
		 tr.appendChild(td4);		 
		 tb.appendChild(tr);
		 if_co.value++;
  

//		 };
        };
	   </script>
       <input type="button" name="add_if_form" style="background-image:url(http://doc.sokrat.net/pic/plus.gif);width:11px;height:11px;border:0px" onclick="add_form_el();"/>
	  </td>
	 </tr>
	 <tr>
	  <td>
	   <input type="hidden" id="if_co" name="if_co" value="1" />
       <table><tbody id="if_form"></tbody></table>
	  </td>
	 </tr>
	</table>
</body>
</html>