knight_riderძაან დიდი კოდია მარა ჰა.

function addForms(){
var AmountofForms = document.getElementById('amount').value;
if( AmountofForms > 0 && AmountofForms!= null){
var f = document.createElement("form");
f.setAttribute('method',"post");
f.setAttribute('action',"userpage.php");
f.setAttribute('class', "form-horizontal");
f.setAttribute('role', "form");
for (j = 0; j < AmountofForms; j++) {
var div = document.createElement("div");
div.setAttribute('class',"form-group");
// var span = document.createElement("span");
// span.setAttribute('class',"col-md-2 control-label");
// span.value = "Owner";
// div.appendChild(span);
var div1 = documment.createElement("div");
div1.setAttribute('class',"col-md-6");
div.appendChild(div1);
var div2 = document.createElement("div");
div2.setAttribute('class',"form-group row");
div1.appendChild(div2);
var name = "name";
name = name.concat(j);
var amount = "amount";
amount = amount.concat(j);
var pr = "percent";
pr = pr.concat(j);
var label = document.createElement("label");
var label1 = document.createElement("label");
var label2 = document.createElement("label");
label.setAttribute('class',"col-md-1 control-label");
label1.setAttribute('class',"col-md-1 control-label");
label2.setAttribute('class',"col-md-1 control-label");
label.setAttribute('for',name);
label1.setAttribute('for',amount);
label2.setAttribute('for',pr);
label.value = "??????";
label1.value = "????????";
label2.value = "?????????";
var div3 = document.createElement("div");
var div4 = document.createElement("div");
var div5 = document.createElement("div");
div3.setAttribute('class', "col-md-2");
div4.setAttribute('class', "col-md-2");
div5.setAttribute('class', "col-md-2");
div2.appendChild(label);
div2.appendChild(div3);
div2.appendChild(label1);
div2.appendChild(div4);
div2.appendChild(label2);
div2.appendChild(div5);
var p = document.createElement("input");
var p1 = document.createElement("input");
var p2 = document.createElement("input");
p.setAttribute('type',"text");
p1.setAttribute('type', "number");
p2.setAttribute('type', "number");
p.setAttribute('class',"form-control");
p1.setAttribute('class', "form-control");
p2.setAttribute('class', "form-control");
p.setAttribute('placeholder',"??????");
p1.setAttribute('placeholder', "????????");
p2.setAttribute('placeholder', "????????/????");
p.setAttribute('name', name);
p1.setAttribute('name', amount);
p2.setAttribute('name', pr);
p.setAttribute('id', name);
p1.setAttribute('id', amount);
p2.setAttribute('id', pr);
div3.appendChild(p);
div4.appendChild(p1);
div5.appendChild(p2);
f.appendChild(div);
}
var k = document.createElement("button");
k.setAttribute('type', "submit");
k.setAttribute('class', 'btn-btn-success');
k.value = 'Add Owners';
f.appendChild(k);
document.getElementById('contain').appendChild(f);
}
}
მოკლედ. არ ვიცი. პირველი შეხებაა ჩემი ვებთან. ჯქუერი არაფერი არ ვიცი. ესე პროსტა დავიწყე თან სწავლა თან წერა.
Fორ ციკლში ბევრი ინფუთები უნდა დაუმატოს Fორმს. დივების გარეშე რომ ვწერ გამოდის. და დივებს როგორც კი ვუმატებ არაფერი აღარ ხდება.