I have two HTML input fields article and url.
How to duplicate field ‘article’ entry to field ‘url’ to SEO friendly link!?
urlallowed symbolsa-z(capital letters converted to lowercase),urlspace symbol replace with dash-,urlother symbols ignored.
required typing just in field article
<input type="text" name="article">
url field is jquery auto generated and updated by field article value
<input type="text" name="url">
This should work:
and then
This sets the value in the url field every time the article field looses focus.
It keeps already existing
-in the name. So if you want to remove them too, you have to change the second last and third last line ofname_to_url()to:Reference:
.blur(),.val(),.toLowerCase(),.replace()Update:
I would create a new function, lets say,
update_URL():then you can call this function on whatever event, e.g. on
keyup():