DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2004
    Posts
    1

    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?

  2. #2
    Join Date
    Feb 2004
    Posts
    808
    java and javascript are different things.. you might be better off asking in a scripting forum
    The 6th edict:
    "A thing of reference thing can hold either a null thing or a thing to any thing whose thing is assignment compatible with the thing of the thing" - ArchAngel, www.dictionary.com et al.
    JAR tutorial GridBag tutorial Inherited Shapes Inheritance? String.split(); FTP?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


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


Sponsored Links