I am making a simple form with about eight input fields. I want the initial value in the field to indicate what people are supposed to enter. For example value="name" so that people know to enter there name there.
My question though is how do you get the initial value to vanish when they enter that field so that the initial value is only a hint and not a permanent value that they have to erase before they can type in their name?
Thanks!
The reset() method resets the values of all elements in a form (same as clicking the Reset button). Tip: Use the submit() method to submit the form.
You can also make an element so transparent that it's invisible using the opacity CSS property. Like visibility: hidden, opacity: 0.0 will leave an empty space where the HTML element is.
The <input type="hidden"> defines a hidden input field. A hidden field lets web developers include data that cannot be seen or modified by users when a form is submitted. A hidden field often stores what database record that needs to be updated when the form is submitted.
A much easier way could possibly be:
placeholder="Name"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With