Is it possible to change image on textbox change?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • butro
    New Member
    • Apr 2007
    • 5

    Is it possible to change image on textbox change?

    Can be changed a picture when an text input onchanged ?

    For Example :

    <form id="form1" method="post">
    <img src="first_pic_ when_page_loade d.gif" id="pic_name" name="pic_name" >
    <br>
    <br>
    Type Correct Image Name And Change Pic : <input type="text" name="image_nam e">

    <input type="submit" value="Go">
    </form>



    In this example it doesn't matter you post form or not ; main issue is when we type an existing file name (such as second_file.gif ) in text box, can first image be chaned and display second_file.gif ??

    We can do this by using selct box ; when you select an option, image can be chaned... In this issue, i try it by using text input when it's changed.

    Thank u for your time ...
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Changed the thread title.

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      Yes, it is possible. For example:
      [HTML]<input type="text" ... onchange="docum ent.getElementB yId('pic_name') .src=this.value ;">[/HTML]

      Comment

      • butro
        New Member
        • Apr 2007
        • 5

        #4
        Thank you very much, i solved my problem with your help...

        Comment

        Working...