I have recently finished a project and now I am facing an issue that needs to be solved. In this project, there are 3 select boxes, each with different names. The first select box is named nameSelectBox162572640796915
, the second one is named nameSelectBox16257264317217
, and the third one is named nameSelectBox162572643286379
.
Each select box has 3 value options: "1", "2", or "3". The challenge is that once a value is chosen in any of the select boxes, it should not be selectable in the other select boxes.
While analyzing the developer tools, I found a way to achieve this. For example, if a value is selected in the first SelectBox, I can write code for the second select box to disable that particular value.
var source = document.getElementsByName("nameSelectBox162572640796915")[0];
source.value;
document.getElementsByName("nameSelectBox16257264317217")[0].options[source.value].setAttribute("disabled","disabled");
The specific page where this issue occurs is http://localhost:3000/#/form
. However, I am unable to locate the exact spot to implement this code effectively. Can anyone provide guidance on how I can address this issue?