Backlog documentation . Front End . Switch radio button based on focus - peterlegrand/SIPx GitHub Wiki

Code in github

_Layout

Explanation

I have a pop up where I can add a current page to my favorites stored in the platform as shown below:

favorites
I go through the following steps:

  1. I press this icon and the pop up will be shown.
  2. I click on the dropdown
  3. This radio button should be selected as I press on 2.
  4. When I click in the text box
  5. This radio button should be selected as I press on 4.

What I want to accmplish is that it should be clear to the user that a new group for favorites will be created to which the favorite is added or that it will be added to an existing group.

Problem

The radio button selection does not change based on if I select the dropdown or textbox

Code

Some of the code I have tried and which is in the _Layout is:
<script> document.getElementById("NewGroup").addEventListener("focus", isNewGroup); document.getElementById("NewGroup").addEventListener("blur", isNewGroup2); document.getElementById("FavoriteGroupId").addEventListener("focus", isExistingGroup); document.getElementById("FavoriteGroupId_hidden").addEventListener("focus", isExistingGroup); document.getElementById("DropDownListId_hidden").addEventListener("focus", isExistingGroup); function isNewGroup() { document.getElementById("NewFavoriteGroup").checked = true; } function isNewGroup2() { window.alert(document.activeElement.id); } function isExistingGroup() { document.getElementById("ExistingFavoriteGroup").checked = true; } </script>

⚠️ **GitHub.com Fallback** ⚠️