SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Evil Genius MilchstrabeStern's Avatar
    Join Date
    Nov 2003
    Location
    Arizona
    Posts
    1,131
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Gmail attachment feature...

    Is it possible to achieve a similar effect to gmails attachment feature using javascript? When you attach a file, you can click "Attach another file" and another file input box will appear. How can I have javascript display a new input box with an incremented name.

    Is this an AJAX application?

    I can handle the processing side with php, but I know little javascript (mostly coding basics).
    ]

  2. #2
    SitePoint Evangelist vikrantkorde's Avatar
    Join Date
    Jun 2004
    Location
    Mumbai, India
    Posts
    541
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi MilchstrabeStern,

    It is a concept of adding the additional file dialog box using <input type="file" name="abcd" /> element in the table or in the DIV or in any kind of container.
    e.g. out this in body
    Code:
    <a href="javascript:AddFreind();" id="hylkAddFreinds">Add More Freinds</a>
    <script>
    var Cnt=0;
    function AddFreind(){ 
    //	var divFreinds=document.getElementById('divFreinds'); 
    	Cnt=Cnt+1; 
    	var newText = document.createTextNode("New Attachment");
    	var newElem = document.createElement("P");
    	newElem.id = "newestP";
    	newElem.appendChild(newText);
    
    	var newElem1 = document.createElement("input");
    	newElem1.id = "textP" + Cnt;
    	newElem1.type = "file";
    	newElem.appendChild(newElem1);
    	document.body.appendChild(newElem);
    }
    </script>
    Vikrant Korde
    S Y S T I M E, Mhape,
    Mumbai, Maharashtra, India.

  3. #3
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by MilchstrabeStern
    Is it possible to achieve a similar effect to gmails attachment feature using javascript?
    See: http://gavin.panicus.org/downloads/g...ttachment.html

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature


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
  •