0

I don't want to go to another page. If i clicked the button modal. I will stay only to the page because the button modal is associated with the form in modal dialog.

But if i click to the tr itself. it will also allow me to redirect to another page.

<tr onclick="window.location='url';" style="cursor: pointer;">

<td>
     <p class="mb-1"><h5>Title</h5></p>
</td>

<td>
<button type="button" class="btn btn-primary btn-sm apply" data-target="#div_jobApplicant" data-toggle="modal" data-modal-type="form" data-id="1">APPLY THIS JOB</button>
</td>

</tr>

Thank you for any help.

ALREADY RESOLVED-------

Reference:

jQuery <tr> link except button which opens Bootstrap Modal

$('tr[data-href]').on("click", function() {
    if(!$(event.target).is(":button")) {
        document.location = $(this).data('href');
    }
});

i just import this code. Thanks

Miks Alibo
  • 61
  • 8
  • I would recommend you inspect the `button` for other function that could be conflicting with your `onclick` event. Maybe do a simple test by removing all the `button` attributes like `class` `data-target` ect... Maybe this answer might be of some help to find those other events. [**Using Chrome, how to find to which events are bound to an element**](https://stackoverflow.com/questions/7338193/using-chrome-how-to-find-to-which-events-are-bound-to-an-element#answer-7338319) – NewToJS Nov 26 '18 at 03:05
  • Thank you for the help. – Miks Alibo Nov 26 '18 at 04:25

0 Answers0