onSelectionLimitReached

Type: function

To be used with selectionLimit option. When defined, this function will override the default behavior (display the alert message) when the selection limit is reached. In this function, you can display your own UI to alert the user or add a custom behavior.

The example below simply logs a message to the console when someone tries to select a 6th contact:

cloudsponge.init({
  selectionLimit: 5,
  selectionLimitMessage: "You shall not pass!",
  onSelectionLimitReached: function(count, message) {
    // this is invoked when the user tries to select a 6th contact.
    console.log(count, message); // => 5 "You shall not pass!"
  }
});

Try CloudSponge for free in your
testing environment

Get Started

Have a questions or prefer a guided tour?
Schedule a consultation with our Founder.