NYCPHP Meetup

NYPHP.org

[nycphp-talk] Removing Text from an Input Box

CED Consult at CovenantEDesign.com
Wed Jun 6 20:48:19 EDT 2007


Set the text as the value, then set it blank onFocus...

onFocus(javascript:document.f.inputfield.value = ""); and
onBlur(javascript:document.form.inputfield.value ="Username";);

-Ed
Edward JS Prevost II
Me at EdwardPrevost.info
www.EdwardPrevost.info
  ----- Original Message ----- 
  From: Ben Sgro (ProjectSkyline) 
  To: NYPHP Talk 
  Sent: Wednesday, June 06, 2007 8:44 PM
  Subject: [nycphp-talk] Removing Text from an Input Box


  Hello, 

  This is more of a JS question, but I'm going to ask it anyways.

  I just got the book, "Pro Javascript Techniques" (Apress) and what sucks is that many of
  the examples do not work.

  What I want to do is have to input boxes, a username and password.
  Instead of having labels next to them such as:

  Username: [INPUT BOX]
  Password: [INPUT BOX]

  I want to have the text inside the box [INPUT BOX: Username]. etc...

  When the user mouses over, I want to make that "Username" text dissapear so they can type their username in.

  Any help?

  - Ben

  Ben Sgro, Chief Engineer
  ProjectSkyLine - Defining New Horizons



------------------------------------------------------------------------------


  _______________________________________________
  New York PHP Community Talk Mailing List
  http://lists.nyphp.org/mailman/listinfo/talk

  NYPHPCon 2006 Presentations Online
  http://www.nyphpcon.com

  Show Your Participation in New York PHP
  http://www.nyphp.org/show_participation.php
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20070606/96091f98/attachment.html>


More information about the talk mailing list