2

I want to combine two content/add/* forms into one form but create two different types of content in drupal 7 on submittiing a single from.

2
  • I have two content types. One is Job Apply form and other is questionnaire. User can create any number of questionnaire. While creating a job I want user to select a questionnaire from dropdown of existing questionaires. That questionnaire will get attached to the job apply form. But I am getting two different forms, but I want one submit button.
    – killbill
    Dec 16, 2012 at 12:32
  • 1
    Have you checked this thread : drupal.org/node/334817
    – j2r
    Dec 18, 2012 at 17:04

3 Answers 3

2

My initial thought on a solution was also entity reference and entity inline form but a few caveats regarding the latter. The enitity inline form adds a submit for the additional content type, this seems against your proposed UX so you will need a hook_form_alter to change this behaviour (and indeed the label) have a look at http://drupal.org/node/1880850 for a solution I worked on that will give you a lead in (but not a solution to) this.

The other issue is that I got a lot of annoying but non-fatal and non-damaging errors when I loaded entity inline form so stability may not be 100% there. This could be an issue.

0

You need to use References module by which,

  • you can reference one node from another node, hence creating a relationship between the two.

    • add a node reference field in your Job content type which will reference Questionnaire content type.
    • you should have some questionnaire nodes first
    • when you create a job, you should get a list of questionnaires to chose from
    • in 'Manage Display' for the Job content type, chose Rendered node as display for the node reference field - So in node view of the job you will have the questionnare node displayed too.

Hope that's helpful.

0

Use the Inline Entity Form and Entity Reference.

Provides a widget for inline management (creation, modification, removal) of referenced entities.

Set up your Job Apply content type and add an Entity Reference field with an Inline Entity Form Widget to reference your Questionnaire entities.

This means that on the add/edit pages your users will have the ability to either create a new Questionnaire or reference an existing one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.