Basically I have a very long form select option drop down list. What I would like to do is that for each option "value", I want to remove the spaces and instead add dash to it. Doing each option value by hand would take me a very long time, so I thought I might try jquery for short cut. If you have another method, let me know.
Here's what I have so far. Doesn't seem to work.
<script>
$(document).ready(function () {
$('#model').change(function(){
var str = $(this).val();
str = str.replace(/\s+/g, "-");
});
});
</script>
// here's an example of select options
<select id="model" name="model">
<option value="john doe" >John Doe</option>
<option value="john smith lu" >John Smith Lu</option>
</select>