代码如下:
<!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>无标题文档</title>
<script>
function getInputNum(_value)
{
if(isNaN(_value)){ return; }
if(_value > 26) { _value = 26;
document.getElementById("inputNum").value = _value; }
var target = document.getElementById("input_number");
var the_element_name= new
Array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r
","s","t","u","v","w","x","y","z");
target.innerHTML = "";
target.innerHTML +='<table>';
for(var i=0; i<_value; i++)
{
target.innerHTML +='<tr>';
target.innerHTML +='<td>';
target.innerHTML += the_element_name[i];
target.innerHTML +='</td>';
for(var j=0;j<_value;j++)
{
target.innerHTML += ' <td><input
name="num[]" type="text" size="1" maxlength="1" id="num[]" /></td>';
}
// target.innerHTML += '<br />';
target.innerHTML += '<td> <input name="element_name[]"
type="text" id="element_name[]" value="'+the_element_name[i]+'" /></td>
</tr>';
}
target.innerHTML +='</table>';
return false;
}
</script>
</head>
<body>
<input type="text" value="1" id="inputNum" onkeyup="getInputNum(this.value)"
/>
<br /><br /><br />
<form action="" method="post" enctype="multipart/form-data">
<div id="input_number">
<input name="num[]" type="text" id="num[]" value="0" size="1" maxlength="1"
/>
<input name="element_name[]" type="hidden" value="a" />
</div>
<input name="" type="submit" value="提交" />
</form>
<p>
<?php
if(isset($_POST))
{
echo '<pre>';
print_r($_POST);
}
?>
</p>
<table border="1">
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<p> </p>
</body>
</html>
--
FROM 113.65.163.*