一区二区三区日韩精品-日韩经典一区二区三区-五月激情综合丁香婷婷-欧美精品中文字幕专区

分享

jquery textext

 bubbi7 2016-02-03

Hello Everyone i have this problem and really don't know how to solve it: i'm using Textext tool to my website ,i type all my tags in the textarea but when i need the tags i can't get them here is my code:

html code:

<textarea id="tagsa" rows="1" cols="70" style="color: black;"   placeholder="Add Your Article Tags.. Max=7" ></textarea>

and here is my textext jquery code:

 function checkLength() {
            if ($("#tagsa").next().children().length < 7) {
                return true;
            }
            return false;
        }

$('#tagsa').textext({
    plugins: ' prompt  autocomplete ajax arrow clear  suggestions tags',
    prompt: 'Add one...',
    ajax: {
        url: '../data.json',
        dataType: 'json',
        cacheResults: true
    },
    tagsItems: eval(get_suggestion()),
    //eval(get_suggestion()),
    ext: {
        tags: {

            addTags: function (tags) {

                if (checkLength()) {
                    $.fn.textext.TextExtTags.prototype.addTags.apply(this, arguments);
                }

                else
                    alert("Only 7 Tags Allowed");

            }
        }
    }
}).bind('tagClick', function (e, tag, value, callback) {
    var url = "Finder.aspx?tag=" + value;
    window.location = url;
}).bind('isTagAllowed', function (e, data) {
    var formData = $(e.target).textext()[0].tags()._formData,
        list = eval(formData);

    // duplicate checking
    if (formData.length && list.indexOf(data.tag) >= 0) {

        data.result = false;
    }
});

i tried this:

  alert(document.getElementById("tagsa").value)

but it doesn't show me the inner text/tags

can any one help me with this?

shareimprove this question
   
I am not sure I understand your question/problem. Is your alert not working even though there is text in your textarea? – Fuzzzzel Nov 30 '15 at 22:48
   
It's unclear what you are asking. Please add more details and clarify, and we'd be happy to help you out. The more code you isolate, the better -- we're much more likely to help with short, isolated code snippets. – gladsocc Nov 30 '15 at 23:21

I couldn't find this operation in the plugin's docs, but after diving in the code I found a way.

$('#textarea').textext({
  plugins: 'tags',
  tagsItems: [ 
    'PHP', 'Closure', 'Java' 
  ]
});

$('#btn').click(function(){
  var tags = $('#textarea').textext()[0].tags()._formData;
  
  $('#result').html(JSON.stringify(tags));
});
<script src="https://code./jquery-2.1.4.js"></script>
<script src="https://cdnjs./ajax/libs/jquery-textext/1.3.0/jquery.textext.min.js"></script>

<textarea id="textarea"></textarea><br />
<button id="btn">Show Tags</button>
<hr />
<pre id="result"></pre>

http:///joquga

shareimprove this answer
   
Wow You are a genius Thanks – Mohemmad_B Nov 30 '15 at 21:45
   
@MohemmadAlBughdadi Thanks for you words ;). My pleasure. Good luck. – Mosh Feu Nov 30 '15 at 21:51

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多

    人妻精品一区二区三区视频免精| 久久国产精品热爱视频| 亚洲国产精品久久精品成人| 日本午夜福利视频免费观看| 亚洲熟女一区二区三四区| 精品国产亚洲区久久露脸| 黑人巨大精品欧美一区二区区| 日本少妇三级三级三级| 欧美一区二区三区性视频| 国产精品日韩欧美一区二区| 欧洲偷拍视频中文字幕| 丰满人妻一二区二区三区av | 久久99午夜福利视频| 午夜久久久精品国产精品| 久久机热频这里只精品| 蜜桃传媒视频麻豆第一区| 五月婷日韩中文字幕四虎| 国产日韩欧美一区二区| 欧美黑人暴力猛交精品| 精品久久久一区二区三| 91国自产精品中文字幕亚洲| 久久本道综合色狠狠五月| 人妻一区二区三区在线| 国产毛片不卡视频在线| 亚洲欧美日韩精品永久| 日韩蜜桃一区二区三区| 亚洲天堂一区在线播放| 在线观看那种视频你懂的| 91免费精品国自产拍偷拍| 激情内射亚洲一区二区三区| 黄色激情视频中文字幕| 91天堂免费在线观看| 91福利视频日本免费看看| 丰满少妇被猛烈插入在线观看 | 国产日韩欧美在线亚洲| 黄片免费在线观看日韩| 国产国产精品精品在线| 真实国产乱子伦对白视频不卡 | 区一区二区三中文字幕| 东京热男人的天堂久久综合| 午夜国产成人福利视频|