victorjonsson / jQuery-Form-Validator

[DISCONTINUED] jQuery plugin that makes it easy to validate user input while keeping your HTML markup clean from javascript code.
972 stars 476 forks source link

Showing countries' flags along the country suggestion text #511

Open 1geeky opened 8 years ago

1geeky commented 8 years ago

Hello,

On the country suggestion feature, how is that possible to show countries flags along their names; As the plugin gets country suggestion requirements from Form-Validator servers apparently?

Thanks

victorjonsson commented 8 years ago

That is not supported at the moment. One solution would be to add each value as a class name.

1geeky commented 8 years ago

Oops sorry I edited the question, I still have the question that does this plugin get the country list from remote source?

About the flags, I found this jquery plugin here: https://github.com/jackocnr/intl-tel-input

erry

But it adds country phone code too.

victorjonsson commented 8 years ago

You can read more about that here http://www.formvalidator.net/#default-validators_suggest

$.ajax({
   url: 'http://....countries.json',
   success:  function(json) {
     $.formUtils.suggest( $('#the-input'), json.countries);
   }
})
1geeky commented 8 years ago

Thank you Victor