Changing image depending on textbox data

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mtgriffiths86
    New Member
    • Jan 2008
    • 13

    Changing image depending on textbox data

    Hey All,

    I am looking to have an image display depending on the text inside a text box.

    The text is appearing in the format example.jpg so it would be able to work in theory.

    What i cannot do it make it so that the image show is the image specified in the text box. Is this possible?

    Thanks in advance

    Matthew
  • Logician
    New Member
    • Feb 2007
    • 210

    #2
    Originally posted by mtgriffiths86
    Hey All,

    I am looking to have an image display depending on the text inside a text box.

    The text is appearing in the format example.jpg so it would be able to work in theory.

    What i cannot do it make it so that the image show is the image specified in the text box. Is this possible?

    Thanks in advance

    Matthew
    Do you mean a local image (on user's computer)? If so you need to know that FireFox will not display local images in a remotely-served document.
    If you still mean to go on with this, you need to show the code you have.

    You're welcome in advance.

    Comment

    • mtgriffiths86
      New Member
      • Jan 2008
      • 13

      #3
      I have a folder called images that contain all the images that i want to use.

      I am using IE7 and not firefox at the moment.

      All i have is a simple form containing text boxes and one input file type.

      I cannot think of a way to get the value in img src tags:

      <img src"TextboxValu e">

      Thanks

      Matthew

      Comment

      • Logician
        New Member
        • Feb 2007
        • 210

        #4
        [CODE=html] <img src="default.jp g" id='viewer'>

        <input type='text' onchange="docum ent.images['viewer'].src=this.value ">
        [/CODE] When you blur the field it should display the image.

        Comment

        Working...