Results 1 to 5 of 5

Thread: Displaying images in a textbox

  1. #1
    Join Date
    Nov 2007
    Posts
    151
    Thanks
    67
    Thanked 0 Times in 0 Posts

    Default Displaying images in a textbox

    I

    I am not sure, there is a need to use Javascript here, however I want to display images in a input text box, like simple Rich text editor.

    Does anyone here have any idea?

    THANKS

  2. #2
    Join Date
    Jun 2008
    Posts
    589
    Thanks
    13
    Thanked 54 Times in 54 Posts
    Blog Entries
    1

    Default

    Yes. I suppose you understand a tid-bit of CSS, so just bear with me if you don't.

    What you wish to do here is put an image in a textbox, correct? If so, that is impossible... However, you may put an image on a textbox. Simple CSS can solve this. In your image tag where the style attribute is, make the position of the images absolute. Here is the code for doing so:

    position:absolute;

    Now, once you have that, place where you wish to place the image. Here is some code to show you, in pixels from the top or left, where it will go, obviously placed ABOVE the textbox:

    top:however_many_pixels_here(integer);
    left:however_many_pixels_here(integer);

    Now, the final bit of code:

    z-index:100;

    All you have to do is paste this code in your style attribute in the img tag. Feel free to tamper with the 2nd and 3rd bits of code.

    Hope I helped.

    -magicyte

  3. The Following User Says Thank You to magicyte For This Useful Post:

    d-machine (09-18-2008)

  4. #3
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    You can make an image as background of the textbox. Use CSS' background property:
    Code:
    <input type="text" style="background:url('image.jpg') center center no-repeat;">
    Hope that makes sense.
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  5. The Following User Says Thank You to rangana For This Useful Post:

    d-machine (09-18-2008)

  6. #4
    Join Date
    Nov 2007
    Posts
    151
    Thanks
    67
    Thanked 0 Times in 0 Posts

    Default

    I'll try this,
    thank you very much!

  7. #5
    Join Date
    Jun 2008
    Posts
    589
    Thanks
    13
    Thanked 54 Times in 54 Posts
    Blog Entries
    1

    Default

    That too .

    -magicyte

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
  •