Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing sortable with Tag-it jqueryui
    text
    copied!<p>I've been using the tag-it plugin from <a href="https://github.com/aehlke/tag-it" rel="nofollow">https://github.com/aehlke/tag-it</a> (demo - <a href="http://aehlke.github.com/tag-it/examples.html" rel="nofollow">http://aehlke.github.com/tag-it/examples.html</a>). </p> <p>In this code there is an option to display the inputted tags in another input, textarea etc. First option -</p> <pre><code> $('#singleFieldTags').tagit({ availableTags: sampleTags, singleField: true, singleFieldNode: $('#mySingleField') }); </code></pre> <p>Here the id - <code>#singleFieldTags</code> is the inputting field which is a list like <code>&lt;ul</code> and id - <code>#mySingleField</code> displays the 'list-ordered' tags with commas between each.</p> <p>All the tags that are added and removed in the <code>#singleFieldTags</code> appear in the <code>#mySingleField</code>. Since there is no built-it sortable function with tag-it, adding a <code>sortable()</code> to change the order of tags in <code>#singleFieldTags</code>, does not change the order of tags in <code>#mySingleField</code>.</p> <p>The second option is a plain with only <code>#singleFieldTags</code> as follows :-</p> <pre><code> $('#singleFieldTags').tagit({ availableTags: sampleTags, }); </code></pre> <p>Although in tag-it.js there is a , the value does not appear in the mysql table after submitting the php form as the above list of tags is placed between <code>&lt;li&gt;&lt;/li&gt;</code>. </p> <p>How is it possible to make the tags sortable and ensure that the same arrangement of tags in the list field <code>&lt;ul</code> to be displayed in the <code>&lt;textarea</code> as in First Option? Or How can the second option of sorting tags within a single field <code>&lt;input</code> work and enabling it to be submitted by a form?</p> <p>EDIT: There is a similar plugin like Tag-it called tagit here: <a href="http://webspirited.com/tagit/" rel="nofollow">http://webspirited.com/tagit/</a> . This plugin has sortable with an input box meaning if the tags were interchanged, and when submitted on form it would appear in the order of the sort. However, the disadvantage being that it has custom themeroller themes these are not similar and cannot even be linked to the ones at jQuery UI (jqueryui.com).</p> <p>But on the other hand, the tag-it plugin (not tagit), can be loaded with these themes but does not provide the sortable function.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload