How do you distinguish which host field is used when using an array on editor.dependent

How do you distinguish which host field is used when using an array on editor.dependent

ethics.systemsethics.systems Posts: 4Questions: 2Answers: 0

How do you distinguish which host field is used when using an array on editor.dependent? The only variable that seems to be available for this is val which only gives the value of the host field, but not the name of the host field.

editor.dependent( ['vendor_number','vendor_fname','vendor_lname], function(val,data,callback) {
    alert(val);   //val only provides value of the field. How do I find out which host field is being used. 

        },
    { 
        event: 'keyup'
    }
    
    
    );

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,695Questions: 1Answers: 10,500 Site admin
    Answer ✓

    Hi,

    When using an array as the first parameter for dependent() I'm afraid there currently isn't a way to distinguish which field the value comes form. That is a flaw - thanks for pointing it out. I will look into how to address that.

    In the mean time, you could just ignore val and get the data from the data parameter (which contains the values for the whole form).

    Regards,
    Allan

This discussion has been closed.