Get parent form field value with javascript

From javascript fired from relationship grid, how to get the value of a field in the parent form? parent.thisItem.getItemById("X"); top.aras.getItemById("X"); getFieldByName("X").getElementsByTagName("input")[0].value;
Parents
  • Quick note: The "contentDocument" object only exists when using Chrome. You can use this instead to support Chrome, IE, and FF:
    // Get the parent form
    var parent_form = parent.parent.document.getElementById("instance");
    
    if (parent_form && parent_form.contentWindow)
    parent_form = parent_form.contentWindow.document;
    
    // Get the field and set the value. Use <tag_name>.<property_name> for the query selector.
    var field = parent_form.querySelector("input.item_number");
    field.value = "123";
Reply
  • Quick note: The "contentDocument" object only exists when using Chrome. You can use this instead to support Chrome, IE, and FF:
    // Get the parent form
    var parent_form = parent.parent.document.getElementById("instance");
    
    if (parent_form && parent_form.contentWindow)
    parent_form = parent_form.contentWindow.document;
    
    // Get the field and set the value. Use <tag_name>.<property_name> for the query selector.
    var field = parent_form.querySelector("input.item_number");
    field.value = "123";
Children
No Data