Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [forms]

Don't use it for entity or entity field forms.

3
votes
1answer
5k views

How to display specific forms in drupal 7?

I need to display the system login form and the system registration form on the same page but different panels (not tabbed like the default). I don't want to build a form from scratch using the forms ...
0
votes
2answers
117 views

Administrator users can add records, end users can view them

How can the administrator users add few records into the database (through a form), and how can the end users view them in the front end? Administrator users will be adding records of training ...
0
votes
1answer
890 views

Create Forms in Drupal and process them

i am new to Drupal and i want to implement training / seminar program in my Drupal site. I want to know how to implement the following features: The administrator will be creating a seminar / ...
2
votes
2answers
1k views

Tracking user contact form submissions

How can I track user contact form submissions on Drupal 6? I'm thinking of something similar to the webform results table but for user contact forms. If not something that complex, then just simple ...
3
votes
1answer
917 views

Add CCK form with overlay or colorbox

I have a CCK form. When users submit the form, and add new content, I would like the form to be viewed in an overlay that allows the form to use all of the browser window's area in a similar manner as ...
0
votes
1answer
723 views

Ideas on how to create a multi-part form, where the form requires completion/approval by another user

Desired form submission workflow: User A fills out a form, along with an email address for User B User A submits the form, which then notifies User B by email of a request to complete and approve the ...
0
votes
1answer
248 views

Use form in the content type [closed]

who use a form in a node? for example I want to create a content type that show in this, my product , description , .... and bottom on this node have a form to get comment and price recommended of ...
5
votes
4answers
7k views

Form element #default_value and AJAX

I can't get a form to display a (default?) value after an AJAX call. I am using the following code: function foo_form ($form, &$form_state, $foo) { $form['#prefix'] = '<div id="foo-form-...
1
vote
4answers
2k views

How do I print the node add form in block.tpl.php?

I am using Microblog. How do I print the node add form in a block? I tried node_add('microblog'), but it doesn't work for me; then, I tried drupal_get_form('microblog_node_form'), but I am still ...
3
votes
2answers
7k views

How do I add classes to form elements in the theme layer?

I want to do it in template.php. The form ID is page_node_form, and there are six form text fields. The default class is "form-text." I want to add "text1," "text2," etc after "form-text" to each ...
1
vote
1answer
156 views

Dates to effect dynamic form behavior

I want a form to display an error if someone is not 18 years old, or display the next form item if they are. After exhausting a lot of time searching for a way to do it, I believe AJAX does not work ...
11
votes
5answers
4k views

How do I remove the revision information from a node edit form?

I'm hoping someone can help a Drupal beginner removing a view from my page. The purpose of it is a for data collection. This is the section I am trying to remove:
0
votes
2answers
2k views

How do I add a form to the block?

I want to add a configuration form for a block. The form's style is the following: one year (label) input text box value eg:$10 two years input text box value ...
4
votes
3answers
6k views

Ajax form that changes a button value

When a user pushes a button element marked with ajax, I would like the callback to modify the button value (text shown on button), and have it updated both in the browser and the form state. Updating ...
2
votes
1answer
867 views

How to make a form on the backend?

I want to create a form for the backend in Drupal 7, something like the following: label 1 text box label 2 text box label 3 text box label4 image image I then invoke the form output in ...
0
votes
1answer
4k views

Error using form API on AJAX submit

I am writing a form using the Drupal 7 form API. On submitting the form (via AJAX), the following error is displayed: An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information ...
2
votes
1answer
619 views

Updating a field value in database via submit handler doesn't update the user profile in UI

I've created the field "Attending" that is attached to the user profile. I have created a form with one checkbox element; when submitted, I've confirmed that the attending_fielddatabase is being ...
19
votes
3answers
15k views

Embed a “node add” form in a page

I'm looking for a way to embed a "node add" form on a landing page. I was using Form Block, but it appears to bring many error because I was using a development snapshot version.
1
vote
2answers
262 views

How to expose individual form elements from user-register-form

So I have a work flow/use case as such: an administrator user creates a user account, associating it to the "guest" role the guest users receive a login link once they log in, I want them to provide ...
0
votes
2answers
3k views

How to overwrite the add content page

I created a content type "test", and I want to overwrite the add "test" content page (http://www.example.com/node/add/test); for example, I want to show something on the right part of the page. How ...
1
vote
2answers
510 views

How to tell the difference between multiple image_buttons on the same form?

Using FormAPI to create a simple set of three image_buttons, in the form_submit handler there is no 'op' value set in $form_state and therefore no way to tell which image_button was clicked. Is this a ...
7
votes
2answers
2k views

(Un-) formatting each form element

When we declare something like $form['textfield'] = array( '#type' => 'textfield', '#title' => 'textfield title', '#maxlength' => 8, '#required' => true, ); The output will be ...
1
vote
1answer
442 views

Form, populate select lists values after unsuccessfull validation

I would like to have select values in my select lists that user poster to script. However when validation is not valid, those fields aren't populated with posted data, so user have to make the choice ...
0
votes
2answers
958 views

Form API select list remove blank entry (default select an entry)

I populate an select list using the following code. $getCompanies = 'SELECT nid, title FROM node where type = "my_type"'; $companiesResult = db_query($getCompanies); $companyArray = ...
2
votes
1answer
867 views

Form submit problem

I have no idea why my form submit only work if I put on screen values of $form argument. If I add: echo '<pre>'; print_r($form); echo '</pre>' to my submit function I am getting new '...
1
vote
1answer
2k views

FAPI 'radios' don't respect '#default_value'?

I noticed that the 'comment settings' radio buttons ('#type' => 'radios') were not respecting their default value settings in my content types. I have several module created custom content types, as ...
1
vote
2answers
218 views

How do I Print/Display Site information Form

I'm trying to print the Site Information Form, and a series of other forms in the near future, inside a lightbox using a snippet of code I found similar to the following. global $user; ...
2
votes
1answer
142 views

Putting a form into a menu

I've started learning Drupal (I'm starting with Drupal 7) and the best way to do that seemed to me to be in creating a custom theme from scratch. I'm trying to create a menu in which the login form ...
3
votes
2answers
1k views

Can you do anything about the div soup?

All the sites I have seen that build on drupal looks like it's hit by div soup. There are so many unused divs produced by the content and some templates I have looked on contribute more by adding even ...
2
votes
2answers
3k views

Using AJAX in Drupal 7 to change a form action

I would like to update the Drupal save_edit module to add an auto-save feature. This would look similar to the Stack Exchange auto-save (draft saved). So far I've gotten the save portion working (...
2
votes
2answers
301 views

Best approach for [back][next] form submitting

I've been doing a [back][next] to [finish] set of forms for user input fields, think of it like a questionnaire for user info where the user can still go back to the previous pages to update their ...
5
votes
3answers
146 views

Is there a module for site explanation messages?

Many sites have text areas which appear to explain things to new users. With an option to hide the message in future. I haven't seen such a module for Drupal, does one exist? I have tried googling ...
9
votes
1answer
14k views

Changing the registration form

I would like to revise the default new user registration form in Drupal 7. Rather than to requst "username", I want to request "full name" with helper instructions to enter the text "username is your ...
2
votes
1answer
290 views

Form won't submit properly on the front page

I have placed a form on the front page of my Drupal 6 site using drupal_get_form('mymodule_form'). I have not done anything different than usual, and I have implemented a validation handler called ...
2
votes
1answer
154 views

I am not able to traverse from the last step to the first step in a multistep form

I have created a multistep form with five steps using programatically. Is there any way to traverse to first step form the fifth step? I have created multistep form as given in example module. In the ...
4
votes
3answers
5k views

Form API to Database

I have been reading Form API Quickstart Guide. I understand how it all works, but I don't understand how to save the data entered into the forms into my own database Drupal style. Or am I supposed to ...
2
votes
2answers
14k views

Example for $form_state[‘rebuild’]

May anyone give me an example of rebuilding the form using $form_state['rebuild'] after user's input?
5
votes
1answer
495 views

How do I include ? and = in a form redirection?

I have a form and I would like to take the value from it, and use it as input for a page view which is created using exposed filters. I have created a submit handler for my first form. I then redirect ...
3
votes
3answers
2k views

How to get latitude and longitude from user with Form API

I want to create a database-driven website with Drupal 6 to gather some information from users that is related to the location; I want to create a form (and I don't want to use Webforms, or CCK) to ...
4
votes
2answers
4k views

How can I add an extra button & submit handler to an exposed view form?

I would like to add a second button to an exposed view form. I am able to get the button to display, but not to have it call the button submit handler. Instead, it behaves just like the standard ...
3
votes
2answers
3k views

Creating a form

I am new to Drupal 6. I have been playing around with the settings and have been able to create a static website. What I can't seem to figure out is how I create a form with some input fields and a ...
2
votes
3answers
336 views

Automatically fill the default vocabulary term associated with a content type when editing a node

What I'm trying to do is to automatically select the default term in the "add content" page based on the user's location in the site. Example: User is currently viewing classifieds listed under "Los ...
1
vote
3answers
632 views

theming a CCK input form

How do I theme a CCK input form? I tried the approach given in this page, but it is not working even after I clear the cache. Here are the steps. Suppose your content-type is: "account_registration" ...
1
vote
2answers
756 views

Save and preview differences in hook_form_alter()

I've created a module which uses hook_form_alter(). When a form is loaded (node/add) I hide a field, and the hook works fine. The problem appears when I do a preview of the form. When the form appears ...
3
votes
4answers
2k views

Combining two node forms: is that possible?

I am using Drupal 6 and I got a node form for a content type. I want to alter the other content type node form inside the first one; is that possible?
3
votes
1answer
449 views

How does form API work for CCK (and other #after_build processes)?

When you want to hook into a CCK form and alter something, you are usually required to call a custom function from $form['#after_build'] (right?). When doing so, I have noticed I can't write $form['...
1
vote
2answers
399 views

Can I expose the signup form through views 2?

I am using Signup and Views in Drupal 6 (I can't install Drupal 7), and I created a view that lists all the nodes for which users can signup. Now I want to enable users to signup for one of these ...
3
votes
3answers
3k views

How to add some JavaScript functions before Ajax begins

How do I add some JavaScript functions before Ajax begins, with FAPI? $form['submit'] = array( '#type' => 'submit', '#value' => 'Upload', '#ajax' => array( 'callback' => '...
2
votes
3answers
401 views

Alternative themed forms for a single custom content type

On a site I would like a "quick entry" form for a custom content type on the front page, while also keeping the "normal" non-customized "node/add/mycontenttype" form. I'm able to customize the "normal"...
1
vote
2answers
1k views

Email-only subscription form with mailchimp module?

I have a mailing list in MailChimp and I recently installed the mailchimp module in my Drupal 6.0 site. The subscribe form for anonymous users has first name and last name input elements, as well as ...