www.webdeveloper.com
Results 1 to 4 of 4

Thread: submit this form...

  1. #1
    Join Date
    Jun 2004
    Location
    Miedzyrzecz, Poland
    Posts
    6

    submit this form...

    This is my code:
    Code:
    <script>
    function send()
    {
        var x = "file";
        
        with( document.getElementById(x) )
        {
            if( value != null)
            {
                document.write( 'Yeah! This file was uploaded!' );
            }
            else
            {
                document.write( Sorry, but this file is not uploaded!' );
            }
        }
    }
    
    </script>
    
    <form name="upload" target="okno" method="post" action="upload.php" enctype="multipart/form-data">
    <input type="file" id="file" name="image_browse" style="display: none" />
    <input type="text" name="image_name" class="pageContentButtonFile" />
    <input type="button" value="Get File" class="pageContentButtonSelect"
    onclick="image_browse.click();image_name.value=image_browse.value;send()" />
    </form>
    I want, in place where is `document.write( 'Yeah! This file was uploaded!' );` send this form. How?

    Sorry, but my english is very weak...

  2. #2
    Join Date
    Aug 2003
    Location
    In my house
    Posts
    4,004
    Replace that line with the following:
    Code:
    document.forms['upload'].submit();
    That should work.

  3. #3
    Join Date
    Jun 2004
    Location
    Miedzyrzecz, Poland
    Posts
    6
    no...

  4. #4
    Join Date
    Aug 2003
    Location
    In my house
    Posts
    4,004
    Really? I tested it out and it worked fine for me.

    Are you getting any errors? What specifically isn't working?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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



Recent Articles