0

when input data to firestore database it's give this error called

Uncaught Error: Function DocumentReference.set() called with invalid data. Unsupported field value: a custom HTMLTextAreaElement object (found in field description)

function errorsea(){
    var datafe=document.getElementById('bugsearch');
    firebase.firestore().collection("aboutproject").doc('10026275myprojectdescripton').set({description:datafe});

}
  <form id="unknownerror">
        <textarea id="bugsearch"></textarea>
        <input type="button" onclick="errorsea()" name="senddata" value="senddata"/>
    </form>

1 Answer 1

1

You're trying to pass an instance of an HTML element object to Firestore. That's not valid. You can only place plain objects or basic JavaScript vales like string, number, boolean, and null.

If you meant to pass the value of the text in the textarea element, you should probably pull it out of the element like this before passing it to Firestore:

var datafe=document.getElementById('bugsearch').value;
Sign up to request clarification or add additional context in comments.

1 Comment

I would never expect this to work without .value.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.