Results 1 to 5 of 5

Thread: is it possible to add or input image in textarea?

  1. #1
    Join Date
    Jul 2010
    Posts
    228
    Thanks
    18
    Thanked 0 Times in 0 Posts

    Default is it possible to add or input image in textarea?

    Good day!

    I creating a news webpage and my news has a image and text. i want to use a text area so that only the news would bew scroll not the whole webpage...I don't know how can i add images in a textarea...

    I hope you can help me..

    Thank you

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Nope. No images allowed in textarea. You could use a division (<div>). Instead of setting its value though, you could set its innerHTML property.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jul 2010
    Posts
    228
    Thanks
    18
    Thanked 0 Times in 0 Posts

    Default

    how can i use <div> in adding images?

  4. #4
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    Try wrapping your textarea in the div tags and add a background image to the div, then make the textarea transparent so the image from the div shows through.
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by rhodarose View Post
    how can i use <div> in adding images?
    Well, that depends upon what you are doing. I'm imagining that you have a textarea. After that, I'm not sure. How are you getting the text into the textarea? You could be doing it with javascript, or via server-side code. It might even be something I'm not thinking of. Which is it?

    Anyways, the options for a division are the same two I mentioned, either javascript or server side code.

    If you were using javascript, you should have been using the textarea's value property to set the text in it. With a division you can use its innerHTML property to set text and even an image or other HTML tags for it.

    If using server side code, things work pretty much the same with a div, as with a textarea.

    To best advise you on how to proceed, I would need to know what you are currently doing to get the text into the textarea. And it would help to see your code or have a link to your page.
    Last edited by jscheuer1; 08-10-2010 at 12:53 PM. Reason: accuracy
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •