0

I want to create a Form in the frontend, so user can able to add the data in the form and submit the data. Then i have to display all the data submitted by the user using that form. Just like a Internal Messaging system. I want a Add Reports Form and i want to list all the reports in a page ( View Reports). I planned to create a content type ( Reports), After that i will be able to add the fields. Upto this i know how to do. But i want to know how to have a row with three fields with add button, then if user click on the button, i want to append a new row with same three fields. Just like Multiple Image upload. I have screenshot. In screen one, i have a add button above a row with three fields. In the screen two which is taken after clicking the "add button" , It displays the same add button with two rows with same three fields .

Screen 1 : enter image description here

Screen 2 :

enter image description here

Any help would be greatly appreciated.

2

Assuming that "Name of Stocklists", "Sales as on Date", and "Closing Stock Value" are all CCK fields, you should be able to do this using Field Collection (https://drupal.org/project/field_collection).

1) Install Field Collection

2) Create a field collection field on your Report content type. Use the embedded widget. Be sure to make the field multi-value / unlimited values.

3) Go to admin/structure/field-collections and click Manage Fields for the field collection you created.

4) Add the 3 stock text fields to the field collection.

5) Now on the Report add/edit forms, you'll have the "Add Another Item" button.

To align the fields in a row, you should be able to use CSS. To make the button a +, you should be able to use hook_form_alter() or hook_form_report_node_form_alter().

-1

You can try Inline Entity Form.

  • Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – mpdonadio Jun 9 '14 at 13:33
  • Can you use IEF on the front end? Also, would it reference the parent node? – AlxVallejo Jul 24 '14 at 17:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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