Onfocus for textarea - mental enema required

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
sjk1000
Forum Commoner
Posts: 26
Joined: Tue Nov 11, 2008 8:50 am

Onfocus for textarea - mental enema required

Post by sjk1000 »

Hi all
I've messed my head up again with quotes and double quotes - I was doing so well.

I have the text area as shown below and I want to add an onfocus to clear the 'Game Title' text when the box is selected.

Code: Select all

print("<textarea rows='1' cols='15' name='gametitle' id='gametitle' >[color=#40BF00]Game Title[/color]</textarea><BR>");
Can someone please tell me how I get the onfocus in there or whether I'm creating my own problems using print("....");
Any help is very much appreicated.
Thanks, Steve
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Onfocus for textarea - mental enema required

Post by John Cartwright »

Code: Select all

print "<textarea rows='1' cols='15' name='gametitle' id='gametitle' onblur='somefunction();'>Game Title</textarea><BR>";
I'm not exactly sure what you were having trouble with exactly, but something like this?
Post Reply