Hey guys i was just wondering how to do this in a input type of text
when the user has not click the box. show “Edit Name” in the box with a slightly grey font color.
When the user clicks in the box it changes to “John Doe” and then they can edit it then submit
//EDIT
doesn’t work as it already has a value set. i need the placeholder to show until clicked then the value shows
If you’re using HTML5 the Placeholder attribute is the way to go.
If not just grab one of the many watermark scripts out there for jQuery or Javascript (e.g. jQuery Watermark.
EDIT
One manual way to do what you want with jQuery and CSS:
Put the
jQuerysection in the code above into the<head>section of your HTML document and you should be good to go.