•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 374,010 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,880 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 900 | Replies: 2
![]() |
•
•
Join Date: Dec 2004
Location: London or Slovakia
Posts: 1,907
Reputation:
Rep Power: 9
Solved Threads: 216
You need scripting language for think like this as you need to run sort of loop cycle, I would say PHP would be your best solution, JavaScript may be to complex. However all depends on your experiences
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
If we helped you to solve your problem, answered your question please mark your post as SOLVED.
Publilius Syrus
(~100 BC)
If we helped you to solve your problem, answered your question please mark your post as SOLVED.
•
•
Join Date: May 2008
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
Let's say you have:
You can create a function like:
<form>
<table id="myTable">
<tr>
<th>Name</th>
<th colspan="2">Phone</th>
</tr>
<tr>
<td><input type="text" name="newname" /></td>
<td><input type="text" name="newphone" /></td>
<td><input type="button" onclick="addContact()" value="Add"/></td>
</tr>
</table>
</form>You can create a function like:
<script type="text/javascript" languaje="javascript">
function addContact(){
var myTable = document.getElementById("myTable");
var newTR = document.createElement("tr");
var newName = document.createElement("td");
newName.innerHTML = document.forms[0].newname.value;
var newPhone = document.createElement("td");
newPhone.innerHTML = document.forms[0].newphone.value;
newTR.appendChild(newName);
newTR.appendChild(newPhone);
myTable.appendChild(newTR);
document.forms[0].reset()
}
</script>![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
- how to format a Datagrid ?? (C#)
- memory management in wndows 2000 (Windows NT / 2000 / XP / 2003)
- Export DataTable to Excel with variable number of fields (VB.NET)
- help (Java)
- Displaying query results dynamically in table (PHP)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: css internet explorer 6 firefox
- Next Thread: getElementById



Linear Mode