Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5935209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:13:18+00:00 2026-05-22T15:13:18+00:00

I need to create a form in the view (not in the edit )

  • 0

I need to create a form in the view (not in the edit) of a content type A.
This form need to submit the data to a content type B.

I notice that node/<nodeID/edit is the “action” of the form which let you edit a node. But if I put the same action in my form on A it shows me the editing node page of B.

My form is as simple as:

<form action="xxx">
  <input type="text" name="cck_field_to_be_added_in_B" value="foobar">
</form>

Setting the xxx action isn’t enough, because the FAPI requires form_id and other stuff… So, How can I build a form which is “correct” and sends the data in the rigth way?

Any idea?

—-EDIT—-

Using the rimian solution it worked. Heres are the dettails:

I needed the form in the view of a node created with CCK. So I have my module with two functions:

function getForm(){ 
    return drupal_get_form('buildForm');

}

function buildIngredientsForm(){
    $form[]... //bla bla bla build the form
    return $form;
}

Because I want this inside a cck content, than I can “hack” the theming system of CCK. Here explain how: http://drupal.org/node/206980

Now, whenever you wats to display your form just call print mymodule.getForm(); and the magic is done.

Regards,
Segolas

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:13:19+00:00Added an answer on May 22, 2026 at 3:13 pm

    Add another callback to the array of functions that are called when the node’s edit form is submitted. You’ll need to understand the basics of the form API. It’s not too hard.

    It goes something like this:

    $form['#submit'][] = 'my_function';
    

    Then..

    function my_function() {
      //do stuff to the other node
    }
    

    See:
    http://api.drupal.org/api/drupal/includes–form.inc/group/form_api
    http://drupal.org/project/examples

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to create a form with, half linear view (textboxes and dropdownlists in
I need to create an XML schema that looks something like this: <xs:element name=wrapperElement>
Maybe that's not exactly the solution i need, but this is what i want
I need to create an ASP page (classic, not ASP.NET) which runs remote shell
I need to create a backup of a SQL Server 2005 Database that's only
I have a simple form: function mymodule_test_form(&$form_state, $nid) { form['submit'] = array( '#type' =>
When I want to edit/view the code for a winforms control/form i created, I
I have multiple MVC 3 forms that need form validation on certain fields (mostly
I need to create a login form with 'username' 'password' fields and two buttons
i use rails and mongodb (mongoid gem). i need to create a select form

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.