Mam tabelę z dynamicznym formularzem, tj dodaje nowe wiersze z polami formularza.
Wiersz tabeli generuje tak:
<script type="text/javascript"> $(document).ready(function(){ // Dodawanie procuktu $('#productAdd').click(function() { var trRows = '<tr>'; trRows += '<td align="center;">'; trRows += '<input class="inputText_x3 input_96_25" type="text" name="formErrandName[]" value="">'; trRows += '</td>'; trRows += '<td align="center;">'; trRows += '<input class="inputText_x3 input_96_25" type="text" name="formErrandWidth[]" value="" onkeyup="formPrice(this)">'; trRows += '</td>'; trRows += '<td align="center;">'; trRows += '<input class="inputText_x3 input_96_25" type="text" name="formErrandHeight[]" value="" onkeyup="formPrice(this)">'; trRows += '</td>'; trRows += '<td align="center;">'; trRows += '<input class="inputText_x3 input_96_25" type="text" name="formErrandPrice[]" value="" onkeyup="formPrice(this)">'; trRows += '</td>'; trRows += '<td align="center;">'; trRows += '<input class="inputText_x3 input_96_25" type="text" name="formErrandCount[]" value="" onkeyup="formPrice(this)">'; trRows += '</td>'; trRows += '<td align="center;">'; trRows += '<img class="delete" style="cursor: pointer;" src="{CONF_ADMIN_THEME}/img/button_delete.png">'; trRows += '</td>'; trRows += '</tr>'; $('#product').find('tbody').append(trRows); }); }); </script>
To działa, problem w tym że nie wiem jak zrobić że jak ktoś wypełni formErrandCount to żeby mi przemnożyło pola z wiersza.
Kombinowałem
$('#product tbody').on('keyup', 'input[name^="formErrandCount"]', function() {
});
i to też działa bo jak wpisze sobie alert('bla'); to się pojawia jak wpiszę wartość w ostatnim polu wiersza, ale nie wiem jak wyciągnąć wartości z tego wiersza.
Pozdrawiam