<body>
<head><TITLE>Test HTML DOM and JavaScript</TITLE>
<script language="javascript" type="text/javascript">
function addNewTexrFields() {
var ni = document.getElementById('testDiv');
var count = ni.childNodes.length;
if(count<4){
count=count+1;
var p = "addDiv"+i;
var testA = document.createElement('div');
testA.setAttribute('id',p);
testA.setAttribute('align','left');
var testTxt = document.createElement('input');
testTxt.setAttribute('type','text');
testTxt.setAttribute('name','test[]');
testTxt.setAttribute('size','40');
testA.appendChild(testTxt);
ni.appendChild(testA);
}
}
</script>
</head>
<body>
<table>
<tr>
<td align="left" width="40%">
text fields
</td>
<td align="left" width="60%">
<input type="text" size="40" name="test[]"> <a href="javascript:addNewTexrFields()">Add More</a>
<div align="left" id="testDiv"></div>
</td>
</tr>
</table>
</body>
</html>
just try it .........
[Friday, November 02, 2007
|
0
comments
]
Popular Posts
- MySQL stored procedure&triggers
- php questions
- Php Questions
- How we canmove into last changed position on info window close event On google map
- Pattern Matching in mysql
- MySQL INDEX
- MYSQL joins
- Jquery based dynamic adding and removal of html elements.
- securing a form with captcha
- Comparing a date with current date
0 comments
Post a Comment
Please put your comments here. your questions, your suggestions, also what went wrong with me.