Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Value Given when tick box is checked :Undefined Array Key

When check box is selected, it copies value from customer to invoice party. So I am assuming that when check box selected. value is automatic. but it is saying undefined array key.

enter image description here

function EnableDisableTextBox(tickSame) {
    var shipper = document.getElementById("iP");
    var customer = document.getElementById("consignee").value;
        document.getElementById("iP").value=customer;   
    shipper.disabled = tickSame.checked ? true : false;
    if (shipper.enabled) {
    
        shipper.blur();

    }
    
}

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

I hope you are submitting the form to the server side. Disabled inputs will not submit data when submitting the form. Instead you can use readonly attribute to make to non editable (Even you can make it look like disabled with css)

function EnableDisableTextBox(tickSame) {
    var shipper = document.getElementById("iP");
    var customer = document.getElementById("consignee").value;
        document.getElementById("iP").value=customer;   
    shipper.readonly= tickSame.checked ? true : false;
    if (shipper.readonly) {
    
        shipper.blur();

    }
    
}

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading