How do I force an inline form to open programmatically?

Currently the form displays an add button for the inline form element and the user has to click on this button before the inline entity form will be displayed. I'd like the inline entity form to be opened by default, without the user clicking on the button. Is there a way to accomplish this programmatically?

Comments

plong0’s picture

Sorry thought I had a solution, but it isn't working properly... don't see where to delete comment.

ovidenov’s picture

Same question.
+1

woprrr’s picture

This operation is the "single" widget. So just change the formatting of multiple field and a single form will be displayed without any additional actions of the user.

ovidenov’s picture

I see that using jQuery .mousedown() method (instead of .click() ).
Hopefully that helps someone.
Regards,
Oleg

a.milkovsky’s picture

To open ief both $element['form'] and $form_state['inline_entity_form'][$ief_id]['entities'][$delta]['form'] should be set.

You can check discussion at https://www.drupal.org/node/1757410#comment-10473522

Also check inline_entity_form_field_widget_form() after "// There's a form open, show it." line.

dcam’s picture

Status: Active » Closed (works as designed)

Closing since there was no response to the given answer.