SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2007
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    URgent help needed from javascript experts

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <script language=javascript type='text/javascript'>
    function showanother()
    {
    span = document.getElementById("fields");
    html = span.innerHTML;
    html = "<label class=\"bot-text\"> Ticket: </label><input name=\"uploaded[]\" type=\"file\" /><br/><br/>";
    span.innerHTML += html;
    }
    </script>
    <form enctype="multipart/form-data" name="image" action="uploader.php" method="post" onsubmit="return checkAmount(this)">
    <span id="fields" >
    <label class="bot-text"> Ticket/label>
    <input name="uploaded[]" type="file" />
    <a href="#" onclick="javascript:showanother();">Upload another file</a><br/><br/>
    </span>
    <br/>
    <input class="button" type="submit" name="submit" value="Upload!" />
    </form>
    <body>
    </body>
    </html>


    the following code dynamically add file upload fields into the form. But the problem is how can i remove the last field (i mean there should be a remove button which help user removing the last file upload field). Second problem is that if i give path for the first file then i click on the add link the new field adds but the data of the previous file field vanishes.
    I will wait for ur kind replies.
    Plz quickly.

  2. #2
    SitePoint Enthusiast
    Join Date
    Sep 2007
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    U can see google file uploader, i almost wants the same thing


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
  •