GeeTee
10-01-2003, 02:23 AM
Hi All,
I am incorporating a Javascript function into an aspx page.
I have a page with a <input type="file" name="Ph1"> control where the user selects a photo to upload. I am trying to pass the name of the selected file to a pop up form to preview the photo (so the user can be sure it is the right one before uploading it).
This is my function, but it does not seem to like it.
<script language="Javascript">function GetPhoto1()
{
window.open('PreviewPhotos.aspx?FileName=' + document.form1.Ph1.value, "Preview", "width=300,height=300,top=200,left=200,toolbars=no,scrollbars=no,status=no,resizable=no");
}
</script>
it is called by:
<asp:hyperlink id="lnkPhoto1" runat="server" navigateurl="javascript:GetPhoto1()">
In the pop up window page load I have the following:
strFileName = Request.QueryString("FileName")
Me.imgPhoto.ImageUrl = strFileName
Can anyone help me with what I am doing wrong?(nb if I remove the "?FileName=' + document.form1.Ph1.value" it opens the pop up, no problem, but obviously no image is displayed, so it appears the problem is in the passing of the file name)
Thanks in advance.
I am incorporating a Javascript function into an aspx page.
I have a page with a <input type="file" name="Ph1"> control where the user selects a photo to upload. I am trying to pass the name of the selected file to a pop up form to preview the photo (so the user can be sure it is the right one before uploading it).
This is my function, but it does not seem to like it.
<script language="Javascript">function GetPhoto1()
{
window.open('PreviewPhotos.aspx?FileName=' + document.form1.Ph1.value, "Preview", "width=300,height=300,top=200,left=200,toolbars=no,scrollbars=no,status=no,resizable=no");
}
</script>
it is called by:
<asp:hyperlink id="lnkPhoto1" runat="server" navigateurl="javascript:GetPhoto1()">
In the pop up window page load I have the following:
strFileName = Request.QueryString("FileName")
Me.imgPhoto.ImageUrl = strFileName
Can anyone help me with what I am doing wrong?(nb if I remove the "?FileName=' + document.form1.Ph1.value" it opens the pop up, no problem, but obviously no image is displayed, so it appears the problem is in the passing of the file name)
Thanks in advance.