开发者

Default value displaying when textbox is empty

开发者 https://www.devze.com 2023-03-22 19:20 出处:网络
I have on load event default values for several text fields. However, when any of the text fields is edited and made blank after it submitted the default values reappear. How do I make it that if its

I have on load event default values for several text fields. However, when any of the text fields is edited and made blank after it submitted the default values reappear. How do I make it that if its empty by the user that it remains empty after submi开发者_如何学运维ssion?


By default value, do you mean the value in the value atttribute? If so, the value attribute doesn't specify the default value, it specifies the current value period. If you don't want it to be displayed, set it to an empty string.

Alternatively, you can use the html5 placeholder attribute which will disappear when the text box gets focus.

0

精彩评论

暂无评论...
验证码 换一张
取 消