Tell us what you are trying to do? I want to assign a child post programatically from a dropdown list. I have a following Relationship Form.
[cred-relationship-form-container]
<div class="form-group hidden">
<label>[cred_i18n name='child-label']Dog[/cred_i18n]</label>
[cred-relationship-role role='child']
</div>
<div class="form-group">
<label>[cred_i18n name='parent-label']Breeder[/cred_i18n]</label>
[cred-relationship-role role='parent']
</div>
[cred-form-feedback field='feedback' name='feedback']
[cred-form-submit field='submit' name='submit' class='breeder_submit']
[cred-form-cancel field='cancel' name='cancel']
[/cred-relationship-form-container]
The Specific Dog is passed on from a Post Form and is hidden. The DIV
<div class="form-group">
<label>[cred_i18n name='parent-label']Breeder[/cred_i18n]</label>
[cred-relationship-role role='parent']
</div>
creates a dropdown list of Breeders (this is a many-to-many relationship as each dog may have more than one breeder assosiated and clearly a breeder may have more than one dog)
so now I want to pick the Breeder in JS. I have used:
document.querySelector('#toolset_select2-cred_association_dam-dog-dog_child-container').textContent="Breeder Name";
where "Breeder Name" is a value that does exist in the dropdown list. And the correct name does appear in the field after executing
.textContent="Breeder Name"; method.
But when I hit SUBMIT the message comes up saying that "This value is required". Picking a value manually by using the dropdown list works but not the .textContent method.
Is there any documentation that you are following? No
Is there a similar example that we can see? No
What is the link to your site? I cannot provide that because the side is only visible from my local computer as I'm developing the site locally