in my admin edit form I set an input field value with a javascript function. The function works and the value is displayed in my input field.
My problem is, that when I save the edit page, Magento ignore the setted value. How can I tell Magento to save my javascript value.
Thats my javascript code inside:
document.addEventListener('readystatechange', event => {
if (event.target.readyState === "complete") {
setTimeout(function(){
if(document.getElementsByName("material_id")[0].value == "0"){
var materialId = "<?php echo $parentId; ?>"
var a = document.getElementsByName("material_id");
a[0].value = materialId;
}
}, 3000);
}
});
As below described, the value is setted, but magento does not save the value.
Thanks for help.
Christian