Handler to grab variable values from another function
<p>This is what I have so far </p>

<pre><code>//file uploader 
///////////////////////////
function uploader(){
    var file = $(this).val()
    var error = $(this).next('.req-error')
    var fileLimit = $(this).attr('maxlength')-1
    var uploadedFiles = $(this).siblings('.uploaded-file').length 

    //make uploaded file label
    if(error.length ==1){
        $(this).next().after('&lt;div class="uploaded-file"&gt;&lt;span&gt;X&lt;/span&gt;'+file+'&lt;/div&gt;')
    }else {
        $(this).after('&lt;div class="uploaded-file"&gt;&lt;span&gt;X&lt;/span&gt;'+file+'&lt;/div&gt;')
    }

    //count uploaded files
    if(uploadedFiles &gt;= fileLimit ){
        $(this).attr('disabled', true)
    }else{
        $(this).removeAttr('disabled')
    } 

    //clear input field
    $(this).val('')
}; 
$(".input-file").change(uploader)

function removeFile(uploader){
    $(this).remove()

}
$('.uploaded-file').live('click',removeFile)
</code></pre>

<p>I made a limit for how many files can be uploaded. Once the limit is reached, the input gets disable but, when a file is removed I want it to enable again if its under the limit. Im just not sure how to get the removeFile function to read the if statement from the uploader function.</p>
