Thread: Limit action
View Single Post
Old 10-13-2007, 11:50 PM   #3 (permalink)
Sam Granger
The Acquainted
 
Join Date: Sep 2007
Posts: 126
Thanks: 4
Sam Granger is on a distinguished road
Default

Quote:
Originally Posted by Salathe View Post
Although you might not think the same, your post is really very vague and lacking details. Post up your code, or a succinct sample, and it'll be ten times easier to provide exactly what you want.
Ok, right now I have a button with the following link: javascript:createFileInput();

The js createFileInput function:

PHP Code:
//** FUNCTION: Create Upload Form
    
function createFileInput(path) {
        var 
tbody document.getElementById('list_body').getElementsByTagName('tbody')[0];        
    
// Create Table Row    
        
var tr document.createElement("tr")
        if (
bg_color) { tr.className="on"bg_colorfalse; } else { bg_color true;}
    
// Create Table Cell
        
var td document.createElement("td")
        
td.id='upload_'+count;
        
td.width='100%';
        var 
output = new Array();
        
output.push("<form id='frmUpload_"+count+"' target='uploadForm' method='post' enctype='multipart/form-data' action='/cgi-bin/upload.cgi?sid="+sid+"'>");
        
output.push("<input type='hidden' name='path' value='"+path+"'>");
        
output.push("<input style='width:100%;' type='file' name='filename' ><\/form>");
        
td.innerHTML output.join('');
        
tr.appendChild(td);
        
tbody.appendChild(tr);    
        
uploads.push(count);
        if (
count != ) {
            var 
tiggerForm document.getElementById('frmUpload_'+count);
            
tiggerForm['filename'].click();
            
tiggerForm null;
        }
        
count++;

        
    } 
Sam Granger is offline  
Reply With Quote