Skip to content
Advertisement

How to warn user if the users type anything different from the assigned value or text

I want to alert or warn user if he types anything else then ongoing or completed on this text box

JavaScript

I tried throwing the value from the option list to firebase but getting error like

JavaScript

Here the option and input list.

JavaScript

Any help would be appreciated thank you!

Advertisement

Answer

This is not an answer, but it is too long for a comment.

From the error you shared, it appears the form data is uploaded to Firebase using script submit.js And this script serializes the form fields. And one of those fields is called “status”, which matches the markup that you shared. However, if you look at the code below, status does not use the value property like all the others. So I’m guessing the script needs to be modified to match your form, i.e., var status=document.getElementById("status").value;

And yet this is a completely different problem from the one asked in the question. As others have suggested, use a SELECT control to limit user choice. Name it “status” and it should work with your upload script.

As I said, this is not an answer, but it is enough to point you in the right direction.

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement