Hallo Leute,
ich hab ein Formular, bei dem es möglich ist einen Teil des Formulars dynamisch zu erweitern. Also es ist möglich eine beliebige Anzahl von Autoren einzutragen(jeweils Name,Vorname,...)
Jetzt möchte ich,dass es möglich ist den zuletzt hinzugefügten Teil wieder zu entfernen.
<script language="JavaScript">
curAuthor = 2;
function addAuthor(IndNr) {
FormTags = "<table><tr><td><b>Author #" + IndNr + "</b></td></tr><tr><td>Surname:<br>" +
"<input type=text name=surname" + IndNr + " size=30></td>" +
"<td>Name:<br><input type=text name=name" + IndNr + " size=30></td></tr>" +
"</table></td></tr><tr><td><table><tr><td>Institution:<br>" +
"<input type=text name=institution" + IndNr + " size=30></td>" +
"<td>EMail:<br><input type=text name=email" + IndNr + " size=30></td></tr></table><br>" +
"<table><tr><td>Is that author member of the programming Commitee?<br></td></tr>" +
"<td><input type=radio name=pcMember" + IndNr + " value=yes>yes<br>" +
"<input type=radio name=pcMember" + IndNr + " value=no>no<br></td></tr></table></table><br>";
DivInhalt = document.getElementById("HierWirdAngefuegt").innerHTML;
document.getElementById("HierWirdAngefuegt").innerHTML = DivInhalt + FormTags;
curAuthor++;
}
Das ist der Code.
Wie kann ich ein remove- Button hinzufügen?