In my project, I have implemented a multi-page form for users to input information. The left side menu contains items that allow users to switch between different pages while filling out the form. Currently, clicking on any of these items redirects the user within the same tab. However, if a user tries to right-click and open in a new window or tab, the desired action does not occur. I would like to enable opening these items in a new tab only when right-clicking on them.
<li id="arrival_button" class="nav-item w-100 side_bar_buttons">
<a onclick="save_and_redirect('mainform','arrival_information')"
class="nav-link align-middle px-0 black_color">
<span class="ms-1 d-sm-inline">Arrival
Information</span>
</a
</li>
<li id="food_drinks_button" class="nav-item w-100 side_bar_buttons">
<a onclick="save_and_redirect('mainform', 'food_and_drinks');"
class="nav-link align-middle px-0 black_color">
<span class="ms-1 d-sm-inline">Food &
Drinks</span>
</a>
</li>
<li id="guest_button" class="nav-item w-100 side_bar_buttons">
<a onclick="save_and_redirect('mainform', 'guest_req');"
class="nav-link align-middle px-0 black_color">
<span class="ms-1 d-sm-inline">Guest Requirements</span>
</a>
</li>
I am aware of using target="_blank" with <a> tags in Django, however, I specifically do not want to implement this feature to always open links in a new tab. Instead, I aim to achieve this functionality only when a user right-clicks on the items.