SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Procrastinator Extraordinaire lucas's Avatar
    Join Date
    Oct 2000
    Location
    Springfield, Missouri, U.S.A.
    Posts
    320
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how to i refer to a textbox without hardcoding the name of the textbox in?

    this is the code i'm using:


    Code:
    <input type="text" name="textboxName" value="initial value" onClick="javascript:this.form.textboxName.focus();this.form.textboxName.select();">
    when a user clicks in the box, the value in the box is highlighted. how would i change the javascript so that i don't have to hardcode "textboxName" into the code?

  2. #2
    morphine for a wooden leg randem's Avatar
    Join Date
    Jun 2002
    Location
    .chicago.il.us
    Posts
    957
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <input type="text" name="textboxName" value="initial value" onClick="this.focus();this.select();">
    ----Adopt-a-Sig----
    Your message here!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •