Hello, i am trying to create a URL friendly address based on an input given by a user. This is with jquery.
I took this code from another site and cant seem to find what i am missing. Thanks for the help.Code:<script type="text/javascript"> function suggestUrl() { var title = ('twig_title'); title = title.replace(/\,/g, '-'); title = title.replace(/ /g, '-'); title = title.replace(/\@/g, '_at_'); title = title.replace(/[^A-Za-z0-9_\-]/g, ''); title = title.replace(/-+/g, '-'); title = title.replace(/-+$/g, ''); $('twig_name').value = title; return true; } </script> <form id="step1" name="step1" action="" method="post"> <input name="twig_title" type="text" id="twig_title" " onChange="showtwigtitle(this.value)"> <input type="text" name="twig_name" id="twig_name" onChange="showtwigname(this.value)"> </form>



Reply With Quote

Bookmarks