Pass values from Method to form fields

Hello, I would like to pass a value to a field of an itemtype by code. I have put it in the "onBlur" event of another field
The case is that I pass the value and it shows it on the screen, but when I click on save (lock), it deletes the data.

What am I doing wrong?

My code:

var input = getFieldByName("mp_dni");
input.getElementsByTagName("input")[0].value = "AAAAAAAAAA";

After passing the value to it:

when i lock:

Too many thanks!!!.