-36

I'm populating email-id in the text box value using ng-repeat. Using the edit icon I'm adding an email-id in the text box and on the text box focus out I have to create a token for the email-id in the text box. I have to find out the token input and create the token

$(".tagemail")
  .parent()
  .focusout(function () {
    $(".token-input").each(function (valindex) {
      if ($(this).val() != "") {
        var value = $(this).val();
        var id = $(this).attr("id");
        $("#" + id).val("");
        thisChild.tokenfield("createToken", value);
      }
    });
  });

But the div of thisChild getting differed.

Kartikey
  • 4,516
  • 4
  • 15
  • 40
kavi
  • 53
  • 3

1 Answers1

4

Your question is not formulated correctly but I think this is what you are looking for this:

https://code.google.com/p/crypto-js/

You can create all kinds of tokens

Or generate a random number:

var rand = function () {
  return Math.random().toString(36).substr(2); // remove `0.`
};

var token = function () {
  return rand() + rand(); // to make it longer
};

token(); // "bnh5yzdirjinqaorq0ox1tf383nb3xr"

Source: Already Answered

Kartikey
  • 4,516
  • 4
  • 15
  • 40
Chop Labalagun
  • 592
  • 1
  • 6
  • 19