I use this routine to auto populate some text areas in a web form and it works well I would like to replace any "forward slash / and or space or multiple space" space with a underscore for in "Input3" for SEO purposes.
Input Example: Bearing 5603/zz
Output Result: Bearing_5603_zz
<html>
<head>
<script type="text/javascript">
function CopyData(val){
var a = document.getElementById(val.id).value
var inputs = document.querySelectorAll(".input");
for(var i=0;i < inputs.length;i++){
inputs[i].value = a;
}
}
</script>
</head>
<body>
Title:<input type="text" name ="Title" id="Text" onkeyup="CopyData(this)"/><br /><br />
Title Input 1:<input type="text" class="input" name ="Input1" /><br />
Title Input 2:<input type="text" class="input" name ="Input2" /><br /><br />
SEO Input 3:<input type="text" class="input" name ="Input3" /><br />
</body>
</html>