views:

28

answers:

1

I'm looking for a jQuery image picker plugin that allows me to do the following:

  1. Display a group of images and let the user select one (and only one) by clicking it
  2. If the user does not like any of the specified images, he should be able to upload his own

Just #1 would suffice, as I can add the code for #2 if necessary

It's not that difficult to do I know, but if there is a standard plugin that people use for this, I'd rather use that than reinvent the wheel.

+1  A: 

Something like this? i dont know if there is plugin but is seems really simple

// HTML
<div id="image_container">
    <img src="blabla" />
    <img src="blabla" />
    ...
</div>
<form ...>
    <input id="image_from_list" name="image_from_list" type="hidden" value="" />
    <input id="image_from_file" name="image_from_file" type="file" />
</form>
// JS
$('div#image_container img').click(function(){
    // set the img-source as value of image_from_list
    $('input#image_from_list').val( $(this).attr("src") );
});