<SCRIPT language="javascript" type="text/javascript">
var n = 1;
var w = 1;
function mknormal(){
w = 1;
n = 1;
document.getElementById("tx").innerHTML= '<input name="file1" type="file" /><br />';
//document.F1.action = "";
}
function plus(){
if (w==1) { plusnormal(); }
if (w==2 && n<5){ plusremote(); }
}
function plusremote() {
n = n+1;
var main = document.getElementById("tx");
document.getElementById("dasminus").style.visibility='visible';
document.getElementById("dasminus").style.fontSize='20px';
var newnode = document.createElement("input");
newnode.type="text";
newnode.name="link";
main.appendChild(newnode);
main.appendChild(document.createElement("br"));
}
function plusnormal() {
n = n+1;
document.getElementById("dasminus").style.visibility='visible';
document.getElementById("dasminus").style.fontSize='20px';
var main = document.getElementById("tx");
var newnode = document.createElement("input");
newnode.type="file";
newnode.name="file"+n;
main.appendChild(newnode);
main.appendChild(document.createElement("br"));
}
function minus() {
if (n>1) {
n = n-1;
var main = document.getElementById("tx");
main.removeChild(main.lastChild);
main.removeChild(main.lastChild);
}
if (n==1){
document.getElementById("dasminus").style.visibility='hidden';
document.getElementById("dasminus").style.fontSize='1px';
}
}
</SCRIPT>
Tag : PHP, JavaScript, Ajax, jQuery, Class Library