Trying to copy the contents of a first textbox as it is typed and replace spaces with hyphens - used this code but it only replaces the first space with hyphen subsequent spaces are nor replaced … If anyone can help would appreciate, I’m not very good with JQuery … thanks …
Code:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>TEST</title>
<SCRIPT language="javascript" src="http://code.jquery.com/jquery-1.9.1.min.js" type="text/javascript"></SCRIPT>
<SCRIPT type="text/javascript">//<=!=[=C=D=A=T=A=[
$(window).load(function(){
$("#title").on("keydown", function () {
$("#url").val($(this).val().toLowerCase().replace(" ", "-"));
});
});//]=]=>
</SCRIPT>
</head>
<body>
<input type="text" id="title" />
<input type="text" id="url" />
</body>
</html>