Advertisement
Guest User

add input dinamicos

a guest
Sep 30th, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2. $(function () {
  3.   function removeCampo() {
  4.     $(".removerCampo").unbind("click");
  5.     $(".removerCampo").bind("click", function () {
  6.        if($("tr.linhas").length > 1){
  7.         $(this).parent().parent().remove();
  8.        }
  9.     });
  10.   }
  11.  
  12.   $(".adicionarCampo").click(function () {
  13.     novoCampo = $("tr.linhas:first").clone();
  14.     novoCampo.find("input").val("");
  15.     novoCampo.insertAfter("tr.linhas:last");
  16.     removeCampo();
  17.   });
  18. });
  19. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement