Input

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
westen
Forum Newbie
Posts: 14
Joined: Mon Oct 29, 2007 9:03 am

Input

Post by westen »

I have a text type input and wish the default text to be a different colour to the text entered by a user. Like "Please enter Name here" in light grey and then the text to be black when the user starts to type. Does anyone know if this is possible?

Thanks for the help,
Westen
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Re: Input

Post by Zoxive »

This is Client side, and requires Javascript. Nothing to do with PHP.

Code: Select all

<input value="text" onfocus="this.style.color='#FF0000'">
Post Reply