tcadieux
10-18-2005, 08:24 PM
Using the below code, i manipulate the img Src when i browse using the Filename input field. However, the number of of filename fields and matching hidden fields is always unknown. I can easily create the two fields on the fly, however, i'm not sure how to manipulate the javascript code so that, say my user changes the file in filename field4, the hidden field4 would get updated also?
function DisplayImage(ImageName,ElementValue){
document.images[ImageName].src=ElementValue;
document.forms['myForm'].elements['hidden_ImgSrc'].value = ElementValue;
<input name="filename<%= x %>" type="File" id="filename<%= x %>" size="17" onChange="DisplayImageMultiples('MyPic<%= x %>',this.value)">
<input type="hidden" name="hidden_ImgSrc<%= x %>" value="<%=Filename(x)%>">
function DisplayImage(ImageName,ElementValue){
document.images[ImageName].src=ElementValue;
document.forms['myForm'].elements['hidden_ImgSrc'].value = ElementValue;
<input name="filename<%= x %>" type="File" id="filename<%= x %>" size="17" onChange="DisplayImageMultiples('MyPic<%= x %>',this.value)">
<input type="hidden" name="hidden_ImgSrc<%= x %>" value="<%=Filename(x)%>">