Skip to content

Unable to set value to BelongTo / BelongToMany #5060

@yong9402211

Description

@yong9402211
  • Laravel Version: 9.38.0
  • Nova Version: 4.18.2
  • PHP Version: 8.1.6

Description:

var aa = document.querySelector('form[data-form-unique-id]');
var formUniqueId = aa.dataset.formUniqueId;
Nova.$emit(formUniqueId + '-myField-value', 1);

Above code success set the "myField" value to 1, but if "myField" is belongTo, then above code not work.
How to assign value to a belongTo field?

Actually I wish to assign value to a BelongToMany field when attach record.

Detailed steps to reproduce the issue on a fresh Nova installation:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions