I have an autogenerated select box (based on the user decisions in other fields). I am useing "onclick" event inside "onlick" event.
The plan:
If the user click on this I have to disable some other fields and the select(dropdown menu) opens. The ideal would be if after the user's previous decision this select opens automaticly but looks like I can't open a select by JS, to make is work in every type of browser, so I have to make the user do it.
At the secound click I would like to get the value what the user choose and do something with it. But the user may not choose it or missclick out from the select and may close it (It may mess up the enable/disable other fields). So I would like to force the user to click on a value if the select is already opened by the user.
Here is the code:
document.getElementById("infodropdown").onclick = (function() //the select opens + I disable other fields
{
document.getElementById("infodropdown").onclick = (function() //the user should choose a value
{
//do something with the input, and enables other fields
});
});
If there any other more advanced way to make the user select if he/she opens the dropdown very welcome. Thanks you very much for any suggestion!