I'm trying to add custom fields to the user registration form. I need to save 2 of them into the Drupal User's database and 1 into my own separate database.
I'm using hook_form_alter to add the fields and then hook_form_submit to save the…
I know that one way is to have a table in database with all the states and then you would read it in your form. Is there any easier way in your opinion guys ?
I feel bad asking for something like this since it is so elementary however I would…
So I think I am almost there conceptually but need some missing pointers.
Objective is to add a few more fields to the normal user registration form, style it a little, then submit it with storing the extra fields in a table.
This is what I have so…
have a general idea on how to use hook alter to modify the feel of the registration form .
However the challenge I have is to not only have the user register, but to save some extra data into another table and then redirect user to a new page.
How…
While form_set_error('field_firstname', t('message')); works fine, how can I do the same for one of several taxonomy fields? e.g. form_set_error('taxonomy[5]', t('message')); (which doesn't work). Can anyone help?
Is there an easy way to allow a user to register as he creates content type. E.g. Let's say there is a content type called "listing". When the user clicks to on a link to create it, and he's not logged in, I want a "register" box to appear ABOVE THE…
I use Drupal 6.x. In my own module I alter each node form an add my own validation handler to it using
$form['#validate'][] = 'my_own_validation_function';
Then I have the function
function my_own_validation_function($form, &$form_state)
{
//if…
is there any interface to decide which fields should be collapsed and which ones not in content pages ?
i.e. Tags is collapsed
Menu Settings is expanded, Authoring is expanded..
I would like the opposite.
thanks
Updated:
Taxonomy super-select field…
I am writing a module and I need to retrieve values set in a form_submit function from a page handler function. The reason is that I am rendering results of a form submit on the same page as the page handler.
I have this working, but I am using…
I created one module in drupal name as newmodule.I use form alter to alter user registration form for adding one field location.When i submit the form, how i can get the value of the new field which i created .
I am developing a Drupal module. Part of it opens a pop-up window, displays some elements in it, and uses JavaScript to transfer input back to the main page.
As this is a small window, I don't want it to display the full theme borders from the…
I am trying to create a form in drupal 6 that has multiple items on the same line. More specificly, I want a right alligned form what has a textfield, dropdown-box, and button all on the same line.
I know how to create the items, but drupal tends to…
I have a module, which includes multistep form. I decided to make one of these steps work like this: free times per employee are rendered as html elements, and when element is clicked, Javascript will apply the value to hidden input field.
So I…
Try to add some additional form items in the new content type add form.
Also try to increase the weight of submit and preview there.
function mymodule_form_alter(&$form, &$form_state, $form_id){
//add some $form items here
…
how can i prefix a name to the uploaded file name in drupal?
Eg: If my uploaded file name is 'example.pdf'
after click upload, i want to rename it as 'myprefix_example.pdf'