My website(D6) have “Quick Enquiry Form”(using webform) & i need to create a new node simultaneously when user click the submit button in webform.
How do i get values from the webform and insert the values to the node when user click the submit button.
Please suggest me how to do this!!
You can accomplish this by creating a custom module. The module will have two functions:
Before you create the module, you should use the core node module and CCK to create a content type that contains all of the same fields as the webform.
HOOK_form_alter
In the example below, substitue the name of your module fir MODULENAME and the ID of your webform for XXX in the switch case. This function adds MODULENAME_create_node to your webform’s submit function array. We will define MODULENAME_create_node below.
MODULENAME_create_node
This is the main function that will create the node.
You’ll also need to create an info file for your module. See Drupal’s documentation on writing info files if you’re not familiar.