Comma Replacement
HTML
<h3>Paste in your string, and commas will be replaced with " -"</h3>
<div>Input:<input id="in" type="text"/></div>
<br/>
<div>Output:<input id="out" type="text"/></div>
CSS
input {
width: 100%;
}
JavaScript
$(function() {
var $in = $('#in'),
$out = $('#out');
$in.keyup(function() {
$out.val($in.val().replace(/[^0-9.-]+/g,""));
});
});