Log in

View Full Version : Forms



rmorton
03-12-2009, 05:38 PM
I have a form on an asp page that includes a input field. I need to show the image that was selected to submit on the page before submitting the form. I need to be able to get the value of the input field before the form is submitted. I would also like to only allow images (ie: jpg, gif) to be submitted. Any suggestions on how I can do this?

Thanks in advance.

icoombs
03-17-2009, 10:17 AM
From what you are saying it sounds like you need javascript code as ASP will not work client side. you need a Javascript that will take the contents of the input box and apply it to the src attribute of a pre placed image tag.

I am not a JavaScript programmer so cant help with the actual code but this should give you an idea as to what you need to look for.

You probably need a Javascript function that is activated in the OnChange event of the form element where the file name is entered.