-
Display image with java before uploading / need to fix this script
I have html form for uploading images from the locla mashine to my server. I would like to display selected image on the page before uploading it.
I combined java script from here:
http://javascriptkit.com/script/cut173.shtml
with another one
This is the code but it causes error:
##############################
<script language="javascript">
<!--
/*Combo Box Image Selector:
By JavaScript Kit (www.javascriptkit.com)
Over 200+ free JavaScript here!
*/
function showimage()
{
if (!document.images)
return
document.images.pictures.src=
document.mygallery.picture.options[document.mygallery.picture.selectedIndex].value
}
//-->
</script>
<INPUT TYPE="file" NAME="file1" SIZE="60" MAXLENGTH="60" onchange='return file1Value(this)'>
<INPUT TYPE="hidden" NAME="picture" VALUE="" onChange="showimage()">
<SCRIPT LANGUAGE="JavaScript1.2">
function file1Value(thisvalue) {
thisvalue.form.picture.value = thisvalue.form.file1.value.toString();
return true;
}
</SCRIPT>
Can anyone fix this?
-
java and javascript are different things.. you might be better off asking in a scripting forum
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks