bmdsherman Posted August 31, 2009 Share Posted August 31, 2009 Is there any kind of script that will display an image as soon as I enter the source of that image into a form field? Quote Link to comment Share on other sites More sharing options...
gevans Posted August 31, 2009 Share Posted August 31, 2009 As long as the source is an online one. A local path will not work.... But http://www.example.com/image01.jpg will work (if the iamge exists) Quote Link to comment Share on other sites More sharing options...
bmdsherman Posted August 31, 2009 Author Share Posted August 31, 2009 Thanks, but do you know how to do it? Quote Link to comment Share on other sites More sharing options...
gevans Posted August 31, 2009 Share Posted August 31, 2009 It's very easy, and google is your friend. http://javascript.internet.com/miscellaneous/change-image.html that's not the correct script, but you should be able to work it out from the concepts that gives you very easily. Quote Link to comment Share on other sites More sharing options...
mrwutang Posted September 5, 2009 Share Posted September 5, 2009 Like gevans said, its simple. create a <script> function changeImg(src){ document.getElementId('imgChng').src=src; } </script> Then create a text box whichll get the url and a button which will call the change function. <form onsubmit='javascript:return false;'> <input type='text' id='url'> <input type='button' onclick='javascript:changeImg(document.getElementById("url").value)'> </form> <img id='imgChng' src=''>. Create an empty image tag with no source and id. I think thatll do it. Din get the time to check the codes, so I donno if itll work. Try it out and tell me if theres any prolem with it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.