Does anyone have a solution for submitting variable data with the trigger click function. In the example below, when a table row is clicked, a bootstrap modal is opened. The relevant table row data is passed to the modal and a form in the modal can be submitted. If there is an error processing the data, when receiving the error I would like to trigger a click on the respective table row and pass the row data to the Jquery function, to reopen the modal so the user can re-submit the form. I've read the trigger click function does not work exactly like a click, but is there a way of doing this?
<table class="table table-striped" width="100%" id="ModalTable">
<thead class="thead-dark">
<tr>
<th>Job No</th><th>Client</th><th>Location</th><th>Description</th>
</tr>
</thead>
<tbody>
<tr id="j421" data-cln="MY CO LTD" data-loc="My Road" data-des="My Work" data-toggle="modal" data-target="#myModal">
<td>ABC/J421</td><td>MY CO LTD</td><td>My Road</td><td>My Work</td>
</tr>
<tr id="j422" data-jnod="ABC/J422" data-eno="31" data-task="new" data-jno="422" data-jtype="std" data-cln="YOUR CO LTD" data-loc="Your Road" data-des="Your Work" data-toggle="modal" data-target="#myModal">
<td>ABC/J422</td><td>YOUR CO LTD</td><td>Your Road</td><td>Your Work</td>
</tr>
</tbody>
</table>
<?php if (session()->has('error_message')) : ?>
<?=
"<script>
$('#j".old('job_no')."').trigger('click')"
</script>"
?>
<?php endif ?>
<script>
$('<?= lang($lang.'.modaltarget') ?>').on('show.bs.modal', function (event) {
var tr = $(event.relatedTarget);
var client_name = tr.data('cln');
var location = tr.data('loc') ;
var descr = tr.data('des');
var modal = $(this);
modal.find('.modal-body #client_name').val(client_name);
modal.find('.modal-body #location').val(location);
modal.find('.modal-body #descr').val(descr);
modal.find('#body_message').hide();
modal.find('#body_content').show();
});
</script>