Failure case for not selecting an option now a permanent solution rather than an alert

Signed-off-by: Eoghan Conlon <eoghanconlon73@skynet.ie>
This commit is contained in:
eoghanconlon73 2023-08-27 17:12:19 +01:00
parent d19fcb9c10
commit 6dc89697e9

View file

@ -29,7 +29,7 @@
listener.preventDefault(); listener.preventDefault();
const option = document.getElementById('options').value.toString(); const option = document.getElementById('options').value.toString();
if (option === '') { if (option === '') {
alert("Need to implement this"); document.getElementById('formStatus').innerHTML = "<span style='background-color: red; color: white'>Failure: Please select an option, then try again</span>";
} else { } else {
const formData = new FormData(formEl); const formData = new FormData(formEl);
const value = formData.get('value'); const value = formData.get('value');