views:

42

answers:

2

i've got a plugin that binds to a selector eg. a button. and when i click on the button then the function executes (showing a windows where i can choose a picture to upload).

the code looks like this:

$('#image_upload').uploadify({
    'uploader':         '../../frontend/jquery/plugins/uploadify/swf/uploadify.swf',
    'script':           'controllers/ajaxcalls/image.php',
});

so it binds to a button with id="image_upload". but this will give the button a different look and i dont want that. i want a regular button look.

so i thought i could use a regular and then when i click on that one, it executes uploadify plugin.

is that possible?

+1  A: 

Uploadify uses a flash button to take advantage of Flash's file uploading abilities. You can't bind it to a normal button as far as I know.

You can style the button though, this thread has some tips.

Mark B
but there has to be a way to trigger a plugin. eg. simulate a click so that the plugin will be triggered.
weng
You can manually call $('#image_upload').uploadifyUpload() from another button's click event, but the flash button is still needed to select which files to upload.
Mark B
that is exactly what i need to do, to call the $('#image_upload').uploadify() from a regular <button>. how do i do that? would be a great help if you could help me with the caller code.
weng
No, it is not. This would still make the upload button a flash button. I think you don't understand how this plugin works. No matter from where you call it, it will generate a flash button, and only this specific flash button will have the upload functionality.
Mef
+2  A: 

Have a look at the documentation. As far is I understand, settings the option

wmode: 'transparent'

should hide the flash-thingy and make your original button visible.

You could also have a look at the buttonText buttonImg hideButton rollover width height cancelImg options that should allow you to style the button according to your requirements.

Mef