strangehouse

strangehouse supports this item

Supported

61 comments found.

ht1080z

ht1080z Purchased

Thanks for this great plugin! Works exactly as you describe and packed with a very detailed documentation. I’m using it with bootstarp v3.3.7 and jquery v3.1 without any problem. Keep up the good work!

Hello.

You can use callback to check if image is selected. E.g:

    var isValid = false;

    $('#example7').shImageSelect({
    maxSelected: 2,
    callbacks: {
        onSelect: function (){
            isValid = true;
        },
        onUnselect: function (){
              isValid = false;
        },
        onSelectedLimit: function (){
            alert('Limit has been reached!');
        }
    }
});

Thanks! Can you tell me who can i validate this variable (not the element) in jquery validation?

You can try next code:
 $.validator.addMethod("valueNotEquals", function(value, element, arg){
  return arg !== value;
 }, "Value must not equal arg.");

 // configure your validation
 $("form").validate({
  rules: {
   SelectName: { valueNotEquals: "Select item" } // value of default selected option
  },
  messages: {
   SelectName: { valueNotEquals: "Please select an item!" }
  }  
 });

by
by
by
by
by
by