How do you get the value of a text input in HTML

Hello
I wanted to create a form and get input from it, and using FormSubmit I get the results in my email, since I’m still learning programming and cannot do the backend processing yet.

I used my freecodecamp survey project to test, and I’m only able to get results for input types that I added values, such as dropdown menus and checkboxes and radio buttons, but not for input types such as texts.
Example, I got results for a radio button like this:

<label for="yes">Would you recommend freeCodeCamp to a friend?
            <input type="radio" id="yes" name="options" checked value="yes">Yes
</label><br>

And not a text input like this:

<label for="name" id="name-label">Name
            <input type="text" id="name" placeholder="Enter your name" required>
</label>

And because of this, for inputs that require text such as name, email, etc, I didn’t get results.

When I add values to these inputs, they rather become the default.

<label for="name" id="name-label">Name
            <input type="text" id="name" placeholder="Enter your name"  value="Maame Yaa" required>
</label>

Could someone please explain the right way to do it, or tell me what I’m doing wrong?

You can read all about inputs on the MDN doc page.

I don’t know how FormSubmit works, nor your familiarity with JavaScript, however it might just be the case that you haven’t given a name attribute to your text input thus the form is not picking it up.

Worth a shot.
However is really trivial to grab your form value and log it locally for you to test it :slight_smile: