Guest User

Untitled

a guest
Jan 15th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. `@Html.DropDownListFor(x => x.idResponsaveis, Model.responsaveis)
  2. <input type='button' value='Adicionar' onclick='adicionarResponsavel()' class='btn' />`
  3.  
  4. function adicionarResponsavel(){
  5.  
  6. var div = document.getElementById('listaResponsaveis');
  7. var node = document.createElement('div');
  8. node.setAttribute('id', 'div' + quantity);
  9. node.appendChild('@Html.DropDownListFor(x => x.idResponsaveis, Model.responsaveis)');
  10.  
  11. div.appendChild(node);
  12.  
  13. }
  14.  
  15. node.appendChild('@Html.DropDownListFor(x => x.idResponsaveis, Model.responsaveis)');
  16.  
  17. function adicionarResponsavel(){
  18.  
  19. var div = document.getElementById('listaResponsaveis');
  20. var node = document.createElement('div');
  21. node.setAttribute('id', 'div' + quantity);
  22.  
  23. var existingDropDownClone=$('#id-of-existing-select-box').clone();
  24.  
  25. existingDropDownClone.appendTo($(node));
  26. }
Add Comment
Please, Sign In to add comment