Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID

image preview

I'd like that just after choosing an image file (with $.filebrowser) the assigned input value was assigned to an img src too.

Thanks for any help.


  • What I do in the blog forms is use a callback like this:

    $('#thumbnail-browse').click (function (e) {
        e.preventDefault ();
        $.filebrowser ({
            allowed: ['jpg', 'jpeg', 'png', 'gif'],
            set_value: '#thumbnail',
            title: "{"Choose an image"}",
            thumbs: true,
            callback: function (file) {
                $('#thumbnail-preview').attr ('src', file);

    From the callback you can do pretty much anything with the file link. Hope that helps!

  • Perfect, thanks!

Sign In or Register to comment.