form field questions

Discussion in 'PHP' started by lowridertj, Jun 6, 2007.

Thread Status:
Not open for further replies.
  1. #1
    I want to use an image as a text field.

    I know how to set the submit / cancel / reset buttons as images

    for instance.

    
    <input type="text" name="username" id="username">
    
    Code (markup):
    How can i make a image show up they can type into instead.

    I thought it would be
    
    <input type="image" background="path/to/image.gif" name="username" id="username">
    
    Code (markup):
    But that does not seem to work.

    Any suggestions please and greatly appreciated.

    TJ
     
    lowridertj, Jun 6, 2007 IP
  2. mojojuju

    mojojuju Peon

    Messages:
    53
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    mojojuju, Jun 6, 2007 IP
    lowridertj likes this.
  3. dp-user-1

    dp-user-1 Well-Known Member

    Messages:
    794
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    110
    #3
    mojojuju is exactly right. I've even dynamically generated a user's IP address and displayed it in the background of a form before.
     
    dp-user-1, Jun 6, 2007 IP
  4. ansi

    ansi Well-Known Member

    Messages:
    1,483
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    100
    #4
    
    <input style="background: transparent url(path/to/img.gif) 0 0 no-repeat; border:none;" type="text" value="voila" id="input_with_bg" />
    Code (markup):
     
    ansi, Jun 6, 2007 IP
    lowridertj likes this.
  5. lowridertj

    lowridertj Well-Known Member

    Messages:
    2,882
    Likes Received:
    40
    Best Answers:
    0
    Trophy Points:
    195
    #5
    ty everyone. rep . given.
     
    lowridertj, Jun 6, 2007 IP
Thread Status:
Not open for further replies.