Display image with java before uploading / need to fix this script


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Display image with java before uploading / need to fix this script

  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?

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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center