Hello community,
I have this line at the end of the Run() from a InputWidget().
return Html::activeInput('text', $this->model, $this->attribute, ['class' => 'form-control', 'onchange' => 'getAddress()']);
Who generate this in the HTML page:
<div class="form-control" onchange="getAddress()">
<input type="text" id="sladdress-address" class="form-control" name="SlAddress[address]" value="" onchange="getAddress()">
</div>
All is working fine, except the script never gets called.
<script type="text/javascript">
function getAddress() {
let list = $('sladdress-address').val().split(",");
document.getElementById("sladdress-address1").innerHTML = list[0];
document.getElementById("sladdress-city").innerHTML = list[1];
document.getElementById("sladdress-state").innerHTML = list[2];
document.getElementById("sladdress-country").innerHTML = list[3];
}
</script>
Any clue?
Thank you.