Advertisement
Guest User

Untitled

a guest
May 24th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. echo'<option data-select="'.$distrito.'" value= "'.$registoq['id_escalao'].'">'.$registoq['id_escalao'].' </option>';
  2.  
  3. // Celula 2 -Escalão
  4. // Cria um <td>
  5. var diasem = row.insertCell(2);
  6. // Cria o select
  7. var esc = document.createElement('select');
  8. // Da o nome ao select
  9. esc.name = 'escalao[]';
  10. esc.className = "form-control";
  11. esc.options[0] = new Option("iniciados", "1");
  12. esc.options[1] = new Option("juniores", "2");
  13. esc.options[2] = new Option("seniores", "3);
  14. diasem.appendChild(esc);
  15.  
  16. var selects = $('select[name="escalao[]"] option');
  17. $('select[name="modalidade[]"]').on('change', function () {
  18. var select = this.value;
  19. var novoSelect = selects.filter(function () {
  20. return $(this).data('select') == select;
  21. });
  22. $('select[name="escalao[]"]').html(novoSelect);
  23. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement