Last active
August 29, 2015 14:07
-
-
Save devloe/81d4b2b99e5afc9f8f77 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sluggify inputs with name attribute beggining | |
// with "title". The result is apply to inputs with | |
// attribute name beggning with "slug" | |
$(".form-extended").each(function() | |
{ | |
var self = this; | |
var slug = $("[name^=slug]", self); | |
$("[name^=title]", self).on("keydown blur", function(){ | |
if(this.value){ | |
slug.val(_str.slugify(this.value)); | |
}else{ | |
slug.val(""); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment