var room_length = document.getElementById('room_length'), room_width = room_length.value.replace(/\./g,','); room_length.value = room_width;