Register    Sign in
Authentification
uCoz Scripts » Others » –

Automatic tags for any module

The script is creating automatic tags for any module, the script removes all spaces and commas, and leaves only a word. See more in Demo.
In "Entry adding/editing page" of module which you use add after $BODY$ :

Code

<script type="text/javascript">  
  var i, res = [];  
  var elemen = ['input[name=title]','input[name*=name]', 'input[name*=tags]'];  
  $(elemen[0]+','+elemen[1]).change(function() {  
  var el = $(this).val().split(' ');  
  for (i = 0; i < el.length; i++) {  
  if (el[i].length > 3) {  
  res[i] = String(el[i]);  
  }  
  $(elemen[2]).val(res);  
  }  
  while($(elemen[2]).val().search(/,,/) != -1) {  
  $(elemen[2]).val($(elemen[2]).val().match(/\w+/ig));  
  }  
  });  
  </script>


You have a demo below.






Autor: cioLAN  2024-04-19, 05:22:26   Views : 1656   

Tags: tags, automatic tags


Total comments (2)
avatar
0
1 Whisper • 16:09:42, 2013-11-01
Site News nu are aceasta pagina Entry adding/editing page .... deci alta metoda nu cred ca exista sa poata fi folosit scriptul in acest modul, sau este\?
avatar
0
2 cioLAN • 21:07:27, 2013-11-01
Incearca sa-l adaugi in "Top part of the website" , "Partea de sus a siteului".
ComForm">
avatar