Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using javascript to send info to 2 other text fields

Status
Not open for further replies.

timcadieux

Programmer
May 25, 2005
129
BE
I'm using the below code to allow my user to browse and pick a new thumbnail. My problem is this is my EDIT page, thus i'm loading the current thumbnail BUT there appears to be no way to fill in the filename in the File type field. I could use a hidden field, but if they do change the thumbnail, how can i capture that new info, could i edit my Jaascript to update 2 fields, the img Src and the Hidden field??
Code:
<script LANGUAGE="javascript">
<!--
// -- DISPLAY A PREVIEW OF A SELECTED IMAGE
		function DisplayImage(ImageName,ElementValue){
				document.images[ImageName].src=ElementValue;
			}

		//  End -->
</script>

                  <tr>
                    <td bgcolor="#CCCCCC"><a class="caption">Thumbnail:</a></td>
                    <td bgcolor="#CCCCCC">
					<input name="thumbnail" type="File" id="thumbnail" size="25" onChange="DisplayImage('thethumb',this.value)"></td>
                  </tr>
                  <tr bgcolor="#CCCCCC">
                    <td>&nbsp; </td>
                    <td><img src="../Images/6_1/Photo_Essays/<%=Thumbnail %>" name="thethumb" width="210" height="70" id="thethumb" > </td>
                  </tr>
 
I asked here becuase ther MAY have been another solution other than using Javascript.
 
If you are looking for ASP alternatives to client-side JavaScript then we need to know when you expect the server to be involved in your user experience.... If the user is editing this image, are they choosing another different image that has already been sent to the browser or are they requesting a new image from the server? Or are they uploading an image?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top