jmadler / emoji-picker

Add a slick emoji selector to input fields and textareas on your website.
Other
1.31k stars 318 forks source link

Is there any way to retrieve "alt" value on submit form #17

Open curbsaleem opened 8 years ago

curbsaleem commented 8 years ago

Hi

I am using emoji-picker in my app. when we click on any emoji. it render following html in text area.

<img src="/assets/emoji//blank.gif" class="img" style="display:inline-block;width:25px;height:25px;background:url('/assets/emoji//emoji_spritesheet_0.png') -75px 0px no-repeat;background-size:675px 175px;" alt=":blush:">

when i submit the form i want to receive values as ": blush :" rather than "symbol "

is thr any way to do that?

Thanks

conradomd commented 8 years ago

This will help me too!

deveshgoyal commented 6 years ago
function unicodeToColon (input) {
      if (!input) {
        return '';
      }
      if (!Config.rx_colons) {
        Config.init_unified();
      }
      return input.replace(Config.rx_codes, function(m) {
        return ":" + Config.reversemap[m] +":";
      });
    };

usage : unicodeToColon('😍')

output : :heart_eyes: