Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I am calling uploadify function ('#ControlName').Uploadify() by clicking on anchor element. But jquery(...).uploadify is not a function error is occuring. The code I have written is below


XML
On .aspx Page

<input type="file" value="Upload Image" class="aReminderCreateUploadImage" id="aReminderCreateUploadImage">
</br>
<a class="aReminderCreateCancel">Cancel</a>



On .js File

JavaScript
$('.aReminderCreateCancel').live('click', function() {
    $("#aReminderCreateUploadImage").uploadify({
        'swf': 'Script/uploadify.swf',
        'uploader': 'Reminder.ashx',
        'auto': true,
        'multi': false,
        'buttonText': 'Add Photos',
        'onUploadSuccess': function(file, data, response) {
            $('.imgReminderCreate').attr('src', data);
        }
        , error: function(res) {
            alert("Outer Error :- " + res.d);
        }
    });
});


Both Scripts Uploadify.js and MyFile.js and CSS of Uploadify are referenced on aspx page.
Posted

1 solution

Please try is as below.

Note : May be your problem is the same name for the id and class attributes.Remove class and add name attribute is as below.

<input type="file" value="Upload Image" id="aReminderCreateUploadImage" name="aReminderCreateUploadImage">
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900