@AdrianoEscarabote
Posted
Hi Saulius K., how are you? I really liked the result of your project, but I have some tips that I think you will enjoy:
to make the submit button only available when the user selects a number we can do the following:
function showOption() {
for (i = 0; i < options1.length; i++) {
if (options1[i].checked) {
selectedOpt1.innerText = `You selected ${options1[i].value} out of 5`;
}
}
sbtn1.addEventListener('click', function (e) {
e.preventDefault();
rtg1.style.display = 'none';
tks1.style.display = 'flex';
showOption();
});
};
The rest is great!
I hope it helps... 👍
@TH3RIV
Posted
@AdrianoEscarabote hi, thanks for your suggestion! While it works to disable the button until a number is selected, it also seems to create an issue of refreshing the page on submission as it has nowhere to send the data.