Fork me on GitHub

Text to Slug

Text to Slug is a neat and small jquery plugin for making slugable input in a form


Get Start


Requires : JQuery
Add jquery and Text to slug js to document
    
        <script src="src/jquery.min.js"></script>
        
<script src="src/text2slug.js"></script>

Demo #1 - Easy Start!

<input type="text" name="slug_tmp" id="slug_tmp">
    
        $(function(){
            $('#slug_tmp').text2slug();
        });
    

Demo #2 - Change hidden input name

<input type="text" name="slug_tmp2" id="slug_tmp2">
    
        $(function(){
        	$('#slug_tmp2').text2slug({input_name:'slug2'});
        });
    

Demo #3 - Change Input Color

<input type="text" name="slug_tmp3" id="slug_tmp3">
    
        $(function(){
          $('#slug_tmp3').text2slug({slug_color:'#DD094C'});
        });
    

Demo #3 - Change Separator

text to Slug Plugin uses hyphen (dash) as separator in output . You can Change It Now !
For Example separate charachters with "#" instead of "-"
<input type="text" name="slug_tmp4" id="slug_tmp4">
    
        $(function(){
          $('#slug_tmp4').text2slug({separator:'#'});
        });