Ok since I'm not good with css, I am using a free css template and somewhere I messed up, because now the textfields isnt displaying an initial value.
I tested a plain textfield everywhere on the page and the value isnt showing however when I created a new html file, linked the css and created a textfield it displays the value.
Can you please point out what's causing this and how i can fix it, or explain how i can override what's causing this?
You should rather use the attribute placeholder to give the default value to the text input field. e.g. @JoeMaffei caniuse.com refers to CSS support. The placeholder attribute is fully supported by all browsers it's just a hassle to change the default styling of it.
MUI TextField Default Value The MUI TextField can display a default value on render by using the defaultValue prop. This is useful if you don't need to externally get or set the TextField value, or if you are using a form. A form will automatically extract a TextField child components value on submit of the form.
TEXTAREAs do not use the value attribute. They display what is contained between the opening and closing tags.
E.g.,
<textarea name="comment">I really like this article!</textarea>
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