mardi 24 janvier 2017

append form and insert checkbox and input inside by jQuery

problem with append div

i would make append inside append

when i click on button add forms and after creat when i click on add new div to append new div

i am very thankfully for any help

[link][1]

  var addcheck = $(".add-checkbox"),
      // button for form        
      addcheck_box = $(".add-box-checkbox"),
      // add form       
      box_checkboxx = "<form class=\"check-control\"><div class=\"checkbox\"><input class=\"form-control\" type=\"type\" name=\"test"+clicked+"\" value=\"test\" /></div><input type=\"checkbox\"  name=\"test"+clicked+"\" value=\"test\" /><input class=\"form-control\" type=\"type\" name=\"test"+clicked+"\" value=\"test\" /><a href=\"\" class=\"add-checkbox\">add new</a></div>",
      // add add checkbox & input  
      checkboxx = "<div class=\"checkbox\"><input type=\"checkbox\"  name=\"test"+clicked+"\" value=\"test\" /><input class=\"form-control\" type=\"type\" name=\"test"+clicked+"\" value=\"test\" /></div></form>",
      // valu zero       
      clicked = 0;

    addcheck_box.on("click",function(){ 
      $(".wrap-surve-input").append( box_checkboxx);
    });



    addcheck.on("click",function(){ 
      clicked++;
      $("form").append(checkboxx);
    });




Aucun commentaire:

Enregistrer un commentaire