Adding smilies in Textarea for format smiles
Posted: 12 Jul 2018, 10:47
I`m busy with updating my comment-system, I use a option for smilies in the JS script from:
coursesweb.net/javascript/texarea-buttons-format-text-colors-smiles_s2
I add images for stickers.
But it suprice because it seems is there a max of 28 items ?
Or i can`t get number 29 & can not find the error 27 & 28 are just working.
coursesweb.net/javascript/texarea-buttons-format-text-colors-smiles_s2
I add images for stickers.
But it suprice because it seems is there a max of 28 items ?
Or i can`t get number 29 & can not find the error 27 & 28 are just working.
Code: Select all
// Add code for clicked smile in element with ID passed in "id_txtfield"
function addSmile(smile) {
// object with characters that represent the smiles, and the name of the GIF file for each one
var smchr = {':BB':0, ':(':1, ':P':2, ':D':3, ':S':4, ':O':5, ':=)':6, ':|H':7, ':X':8, ':-*':9, ':B':10, ':V':11, ':A':12, ':S':13, ':Q':14, ':W':15, ':E':16, ':R':17, ':T':18, ':Y':19, ':U':20, ':I':21, ':O':22, ':FF':23, ':GG':24, ':HH':25, ':JJ':26, ':STICKERA':27, ':STICKERB':28, ':STICKERC':29}
Code: Select all
<div class="dropdown">
<button class="dropbtn">stickers</button>
<div class="dropdown-content">
<form name="formc" id="formc" method="post" action="script.php" style="position:relative;width:100%;text-align:center;">
<div id="getcolor" style="display:none;margin:3px auto;background:#fff;">Colors</div>
<div id="stickers">
<img src="icos/27.gif" alt=":STICKERA" title=":STICKERA" class="addsmile" style="cursor:pointer;border:none;" onclick="addSmile(this)" />
<img src="icos/28.gif" alt=":STICKERB" title=":STICKERB" class="addsmile" style="cursor:pointer;border:none;" onclick="addSmile(this)" />
<img src="icos/29.gif" alt=":STICKERC" title=":STICKERC" class="addsmile" style="cursor:pointer;border:none;" onclick="addSmile(this)" />
</div>