I have a textbox as
@Html.TextBoxFor(m => m.SingleUnitBarcode, new { @class = "form-control",@id="barcode1", onblur = "CloneData" })
And on losing focus from this textbox I want the text in it to be displayed in another textbox(with id =customerbarcode_field)
I am using the javascript
<script>
function CloneData() {
var value = document.getElementById("#barcode1").value
document.getElementById("#customerbarcode_field").value = value;
}
</script>
However the function is not being triggered when I lose focus from the first textbox.
What did i miss ?
onblur = "CloneData()"<-- notice the brackets, also remove the starting#insidegetElementById