Forms are the primary method for obtaining and acting upon user input in Drupal.

learn more… | top users | synonyms (1)

0
votes
0answers
10 views

Get ID name from form input field and reuse

I'm trying to figure the best way to get a form id from the search block form for example. I want grab the id that's in the input field and insert that name in my label tag. For example <input ...
1
vote
1answer
19 views

hook_form_alter based on path

I don't know if this is possible but could I do something like <?php $foo = current_path(); print $foo; ?> in page--foo.tpl, then something like function ...
1
vote
5answers
87 views

How to get the $form_state in hook form submit?

I need to create a node when a comment is submitted in nodes. There are two content types image and memory and I need to get node ID of the node that a user is inserting comment in it. Here is my ...
0
votes
2answers
23 views

How can I add a second submission handler to a form to run after the default handler node_form_submit

I need to generate a node of a dependent content type when creating a node of the primary content type. I have successfully created the function to be called and attached it to the form and it ...
0
votes
1answer
10 views

How can i load a table on changing a select option using AHAH callback

I have drop down in a form as follows and i want to load a table of data using the drop down value , here is i have tried , function list_user_form(){ $form['howmany'] = array( '#title' ...
0
votes
1answer
17 views

Add prefix to the error message

How I can add some prefix to the all error messages? Example: This field is required! and I need Error: This field is required! I'm using Clientside Validation module for error messages in my ...
0
votes
1answer
24 views

TimePicker Rendered by an Ajax Callback Function Doesnt Show Up

I have a select form element that fires an ajax callback function everytime its value changes. $form['template_options'] = array( '#type' => 'select', '#options' => array( 1 ...
0
votes
1answer
16 views

Custom user_register_form for Auto Assign Role registration pages

I'm using a function[a] to get custom templates to work for all pages, including role registration pages set by Auto Assign Role. By setting the role registration path to ...
0
votes
0answers
19 views

Theming Custom Form module

I make a form programmatically, and i am looking how a web designer can change render. If the path of my form is /test the suggestion template form--test.html.twig doens't work. For example how can ...
0
votes
1answer
13 views

Drupal Ajax breaks after one fire

This is a very frustrating and recurring problem for me because it seems to come and go at random, one minute it is working beautifully, the next moment I make a change and it breaks. Even if I ...
0
votes
0answers
17 views

Render admin forms in a node body?

I have a node and in body field I'm giving a token as [form:node_page_form]. On saving the node, it iterates the token and render the node add form. I could render login form, registration form but ...
0
votes
1answer
20 views

Display date picker not inline in Drupal 7 Forms API

I have installed Date Picker Module and it works fine. Below is the code: $form['date'] = array( '#title' => t('Select your birthdate'), '#type' => 'datepicker', '#date_format' ...
0
votes
0answers
6 views

Custom nested element and its child sub-elements callbacks

I'm trying to create a custom element that consist of a few other elements, namely some select box and one timeperiod element. I've set up custom #process, #value_callback, and #element_validate and ...
0
votes
1answer
27 views

Sending data via post and redirecting user

So I made a module that needs to gather some data and redirect user and that data to a payment site. function payment_upload_form($form, &$form_state){ $form = array(); $form['#action'] = ...
1
vote
3answers
38 views

Changing node/%/edit title

I have created custom content type for upload the details. I have used hook_form_alter to set the node title as "Upload". When I edit the node in node/%/edit the title remains "Upload". I want the ...
0
votes
0answers
19 views

drupal ajax changes my fieldset to a copy of the incorrect fieldset

Hi I'm a newbie to drupal and I'm practicing using drupal 7 forms #ajax. I have 2 fieldsets the ingredient fieldset and the steps fieldset. when I click add step it works fine but when I click add ...
0
votes
0answers
18 views

Modify $form_state variable [closed]

I have a hidden textfield in my form with a value of 'Wew'. $form['myid_id_number_input']['unique_id'] = array( '#type' => 'textfield', '#name' => 'unique_id', '#value' ...
0
votes
0answers
12 views

how to trigger ajax on selected item in drupal ajax commands framework?

I am having form element of type "#select", I want, whenever I changed select list options, an event is called and call my function on that event change. for example: function ...
0
votes
2answers
23 views

State of form element based on global config

I have a form_alter that adds some settings on a content type. How can I make one of these elements hidden (and cleared?) based on the value of a global config (set with variable_get)? I found the ...
0
votes
0answers
16 views

How do I display links based on user's role and reference?

I am building an evaluation platform in Drupal using either entity forms or webform. Attendees will evaluate the course, instructor, and location of the lab/site. "Entities" are: courses: which is ...
1
vote
2answers
33 views

How to rearrange fields in user/%/edit page

I have tried rearranging fields in user/edit page and I succeeded in arranging only few fields. I cannot move user image field and timezone field. I have used hook_form_alter and ...
1
vote
1answer
20 views

Adding a form to Views Bulk Operation for configurable operations

I have a view with a list of nodes that I want to operate with, but I need additional user input for the function. Until now, I have been handing this by having many similar, but slightly different ...
0
votes
1answer
16 views

Update field data added in user form using a hook?

I've added three fields in user form. User code User name User ID. I want to add this field data into the database. My question is, in which hook, i should write the logic of manipulating and ...
0
votes
0answers
18 views

Displaying fields and populating value from database in textfield using ajax.

I am having one search form. In which I took three fields, Month, Year and Email address accordingly. 1. I want one text box field and submit button on condition like if all those three are field. ...
0
votes
0answers
23 views

How to set checkboxes on a tableselect

I want to display tableselect with a column with only checkboxes this is my code : function liste_sections($form, &$form_state){ $form = array(); $form['checkbox'] = array( '#type' => ...
0
votes
0answers
10 views

$form_state['values'] not updating until AJAX call performed

I've got a form that is just a table with 1 column of textfields (will expand that into multiple columns in the future). I've got a button that allows to append a new row to the form via AJAX. And ...
1
vote
1answer
22 views

Drupal 7 Form API, Checkboxes with key -> value from database

I'm working on a custom module and I'm adding a form that uses checkboxes. All is fine with using code like: $form['tags'] = array( '#type' => 'checkboxes', '#options' => array( 88 => ...
0
votes
0answers
28 views

How to get content type field value from content type select list

I have a select list in which all content type's name are populated(say: article, Basic page, etc). Now when I select "Article" from select list, all field's value of "Article" content type get ...
0
votes
0answers
7 views

Theming a form for custom page in D6

I have a page like url/microsite/conclave/ and I am rendering page in template folder like page-microsite-tpl.php , which is working correct as i expect. Now I want to create a form in ...
0
votes
1answer
63 views

how to add edit and delete button to custom html table

I've a db_select to fetch data from sql table, and $output .= theme('table'...) to generate an html table to display these data in columns. My question is, how can I add edit and delete buttons to ...
1
vote
1answer
20 views

Need help with my form with duplicate file and resetting form

Need help with my form for uploading an image on my theme's settings. I have a form that uploads an image that can be used as a background image. I have two problems with my form: first is how to ...
1
vote
1answer
20 views

Embedding a custom form in node.tpl.php does not trigger validation

I'm trying to render a custom form in node.tpl.php. The form is rendered properly and submit handler works. However, the validation handler is not triggered properly upon submitting. If I refresh the ...
0
votes
0answers
29 views

Tableselect with only checkboxes in every line

As said in the title, I want to create a table made of a list of "persons" (the left column) and few columns in order to only check properties of every person, that why I need only checkboxes on this ...
2
votes
2answers
117 views

How do I embed a form in a controller response?

I have a controller that returns a normal renderable page array. I'd like to embed a form in that page, but the form is not appearing in the rendered output. The form is properly added to the ...
1
vote
3answers
76 views

How to add login form to the Access Denied page?

I'm trying to add a login form to the access denied page, and wonder if this is possible via the UI. Any suggestions/ideas?
0
votes
0answers
16 views

Drupal 7: Entity Reference to Profile2

I have a Content Type which has a EntityReference field to a Profile2(I get all users from there and display them as check-boxes). The problem I have is that instead of the User name from that Profile ...
0
votes
1answer
22 views

Delete/Edit selected record from rendered tabular form results

I have made a form and retrive form submissions into a tabular format. I put 2 links ahead every single submission - Edit/Delete Now, when I click "edit", its corresponding edit form should open. ...
1
vote
0answers
21 views

Where can I view different form modes?

I created a simple content type and a form mode for this content type. Where can I view this form mode after creating it? I see no option for form modes when creating a content type. I would have ...
0
votes
1answer
26 views

Move timezone field in user/%/edit field

I want to move timezone field in user/%/edit form. I have used$form['#weight'] in hook_form_alter() and $page['#weight'] in hook_page_alter(), but not working.
0
votes
1answer
52 views

Get the value of a form element returned from an ajax callback function

I have a select element and submit button in my form : $form = array(); $form['myid_template'] = array( '#type' => 'fieldset', '#title' => t('Select Template'), '#suffix' => ...
0
votes
1answer
29 views

Add new field to node form on validate

I am performing a hook_node_validate() and would like to add a new field (e.g. a textfield) during the processing of this function. Is this possible? If so could someone let me know how to do it. I ...
1
vote
1answer
11 views

Form does not save value to variable

I'm loosing my head. This is the function for generating my admin form: function section_description_and_images_settings() { $form = array(); $form['images_style'] = array( '#type' => ...
0
votes
0answers
14 views

How to embed an additional WYSIWYG module or form in drupal page?

I am creating a website which will ideally allow for the transcription of handwritten documents. I want some of the users to be able to upload images which will then display as a slide show. The page ...
3
votes
3answers
110 views

Content submission by anonymous users

I am working on a website that displays a list of historical events. Most of the events have been added by a small group of users that manage the site. However, I would also like to add the ability ...
0
votes
1answer
35 views

Ajax Callback Function Not Working in A Button

I have one select element, that calls an ajax callback function when it's value changes: $form['myid_template']['template_options'] = array( '#type' => 'select', '#options' => ...
0
votes
0answers
16 views

How to use tabledrag within multiple tables

I have a form that has three groups of elements which are presented via tabledrag form element. I would like to be able to move the rows between the tables, so not just within a single table as ...
0
votes
0answers
28 views

Submit form and display confirmation page in CTools modal

I've been all around this issue, but haven't found the right magic to make this work. I have a Drupal 7 custom form that collects information from a user, which gets validated before submitting, that ...
3
votes
0answers
38 views

Conditional fields not working with hierarchical select module

Case: I am using the Hierarchical Select module for allowing users to choose taxonomy terms from a particular vocabulary. Based on the chosen terms (deepest level), I want to display a field using the ...
0
votes
1answer
29 views

Hide conditionally hidden fields from custom node template

Case: I am using conditional fields module to hide some dependent fields based on the value of its dependee field. I have created a custom node--content-type.tpl.php template for my content type. ...
0
votes
1answer
22 views

How do I get $form_state from hook_entity_update()?

I've manipulated the edit node form via hook_form_BASE_FORM_ID_alter() to insert a select pull-down menu. In my module, I've implemented hook_entity_update() to fire when the edit node form is ...