If you use jQuery you can do it with the following code:
<script>
$(document).ready(function () {
$("#OrigenAeropuerto").on("click", function () {
if ($(this).is(":checked") && !$("DireccionOrigen").val()){
$("DireccionOrigen").val($(this).val())
}
})
})
<script>
<label><i class="fa fa-map-marker"></i> Origen</label>
<input type="checkbox" name="OrigenAeropuerto" value="Aeropuerto SCL">
<i class='fa fa-plane'></i> Aeropuerto?
<input type="text" name="DireccionOrigen" id="geocomplete_origen" class="form-control input-sm" required/>
Now if you want to do it with javascript , then use the following code:
<script>
function OrigenAeropuerto_checked() {
var i = document.getElementById("geocomplete_origen");
if ( this.checked && !i.value ) {
i.value = this.value;
}
}
</script>
<label><i class="fa fa-map-marker"></i> Origen</label>
<input type="checkbox" name="OrigenAeropuerto" value="Aeropuerto SCL" onClick="OrigenAeropuerto_checked()">
<i class='fa fa-plane'></i> Aeropuerto?
<input type="text" name="DireccionOrigen" id="geocomplete_origen" class="form-control input-sm" required/>
It will be your choice which method to use, however it is important to clarify that jQuery tends to make everything much easier although in this example this advantage is not remarkable.
I hope I have helped, Greetings! ...;))