FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Adding textbox dynamically. HELP!





JC Vincent Pelletero
Hi. Im wondering, how can I add a textbox dynamically with different names?
I'm creating a Personnel information system right now. And i'm at the siblings information. How can I add a text box with different names if the employee has 3 siblings? the other 4, the other 5 and so on? please help!

this is my code but the textbox doesn't have a name when it is created.

<html>
<title>Insert Table Row using DOM</title>
<center><br><br>
<head>
<script language="javascript">
function addRow()
{
var tbody = document.getElementById("table1").getElementsByTagName("tbody")[0];
var row = document.createElement("TR");
var cell1 = document.createElement("TD");
var inp1 = document.createElement("INPUT");
inp1.setAttribute("type","text");
inp1.setAttribute("size","35");
cell1.appendChild(inp1);
row.appendChild(cell1);
tbody.appendChild(row);
}
</script>
</head>
<body>
<table id="table1">
<tbody>
<tr>
<td><input type=text name="original" size="35" maxlength="75"></td>
</tr>
</tbody>
</table>
<input type="button" value="Insert Row" onClick="addRow();">
</body>
</html>


Also, I can't set the maximum length of the added textbox. Please. Any help would be appreciated. Thank you so much![/quote]
hexkid
You are missing the php tags.

[ Edit: ] Try the Html, CSS and Javascript forum.
manum
u can do so using jscript DOM
Related topics
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.