hlsolutions / jquery-autosuggest

An AutoSuggest jQuery plugin.
http://hlsolutions.github.io/jquery-autosuggest/
GNU General Public License v2.0
15 stars 3 forks source link

Add validation messages for `minChars` and `maxChars` fixes #24 #25

Closed coryschires closed 11 years ago

coryschires commented 11 years ago
knalli commented 11 years ago

Yeah, thank you!

I have some issues

Let's make this PR final, but for the next time consider to make a topic branch for such stuff. It's better :)

Do not let fool by Travis.. the tests are still okay!

coryschires commented 11 years ago

You raise some good points:

  1. I totally forgot about the onRenderErrorMessage callback, though I do think it's a good idea. I'll add it.
  2. Regarding "no message in your demo when I have typed in only 2 chars". I had coded it that way initially but it felt a bit weird having the validation message flashing at me before I'd finished typing my tag name. For example, if I'm adding the tag "delicious", I shouldn't see a validation message when I've typed "de" but have no intention of adding the "de" tag. So I think it's better to only show the minChars validation when the user tries to add a tag with too few characters. For maxChars, however, I think we want to let the user know as soon as they've typed too many characters – even before they've attempted to add the tag. Does that make sense?
  3. Regarding "The result list will be shown every time a "suggest" will be tried by aborted because the maximum was reached already (11, 12, 13, ...)". I don't know what you mean. Can you explain in more detail?

I plan on making these changes tomorrow. Thanks again for being so responsive!

knalli commented 11 years ago

Even if the maximum of chars is reached, the box "No results were found" will be flashed. Additionally, the error message will be shown.

coryschires commented 11 years ago

@knalli I think those two most recent commits address your concerns.

Lemme know if it's good to go.

knalli commented 11 years ago

Yes, seems to be good. I'll look for it tomorrow's eve.

knalli commented 11 years ago

Thank you! (Sorry for the unexpected delay).