Hi Team
The coding is working, now the problem is to find a way when and after filter search. Want to take the result to pass it to the text field from the form using ajax. Below is my current logic.
// ajax call
Hi Team
The coding is working, now the problem is to find a way when and after filter search. Want to take the result to pass it to the text field from the form using ajax. Below is my current logic.
// ajax call
// form
@Html.LabelFor(model => model.Auditor, htmlAttributes: new { @class = "col-md-4 col-form-label text-md-right" })
Jithu ThomasPosted Mar 4, 2024, 7:26 AM
In this updated code:
var selectedUserDisplayName = $('#userTable tbody tr.selected td:first').text();retrieves the display name of the selected user from the first column of the selected table row.$('#auditor').val(selectedUserDisplayName);sets the value of the#auditortext field with the selected user's display name.$('#userTable tbody tr').removeClass('selected');removes the 'selected' class from all table rows, ensuring that the next time the modal is opened, there are no previously selected rows.Make sure to include these changes in your existing JavaScript code.
Tuhin PaulPosted Mar 9, 2024, 8:24 PM
Instead of selecting the first column of the selected table row using
$('#userTable tbody tr.selected td:first'), you can optimize it by directly targeting the first column with$('#userTable tbody tr.selected td:eq(0)').