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

learn more… | top users | synonyms (1)

0
votes
0answers
6 views

Custom menu with drupal_get_form plus form_alter_hook

I'm working in Drupal 6 to create a custom module. I have a menu that creates some custom URLs and tabs for me, and each item runs a page callback function, which itself runs drupal_get_form. What ...
0
votes
1answer
7 views

Sending Auto-filled Email from Content Type Profiles

I have 'resource' content types. There are hundreds. I want each profile to contain an individualized link to a 'feedback form', or some mechanism to report an error with the profile, by email...to ...
0
votes
0answers
13 views

Drupal 7 node save gives intermittent token validation error

When submitting a content type node I'm occasionally seeing a form validation error regarding tokens being invalid. I've tried reducing the token tree depth too using Token Tweaks which helps on ...
1
vote
1answer
10 views

Ajax in a form produces an error

suppose this form: function test_ajax_form($form, &$form_state){ $form['school'] = array( '#type' => 'textfield', '#title' => t('School'), ...
0
votes
0answers
8 views

Ajax File upload breaks/repeats all custom javascript

I've created a multi-step entityform which includes a file upload field. Everytime file is uploaded the form navigation breaks. Nothing happens when clicking next or prev buttons and there's no ...
0
votes
1answer
20 views

How to query the database to create a report based on user input variables in a form?

I am creating an example report of user data based on selection criteria selected in a form. I can create the form variables, and I can redirect the user to the report output page, but how do I ...
0
votes
0answers
12 views

managed_file upload clearing $form_state

I am having an annoying problem whereby $form_state['values']['region'] and $form_state['values']['country'] are being cleared when I upload an image via the managed_file field. This is causing a ...
0
votes
1answer
41 views

How to populate the select option using select index

-- Modifying my previous question -- This really got me. This is what I am doing right now with my module. I created a menu_hook which creates a form using a theme to create data. Another menu link ...
0
votes
1answer
9 views

How to render Entityform submission (entity) without DOCTYPE and HEAD tags?

I need to render entity as a part of page instead of individual page. By this I mean I want to able to render it without DOCTYPE declaration and HEAD tags. Typically this could be done within ...
-1
votes
0answers
15 views

Insert item in every comment using Comment.module

I need to insert a button on every comment(not on comment-form) which will submit informations about the comment to a php file. So I have to create a form with hidden fields(just the button is ...
0
votes
1answer
17 views

Set default value for Enity Reference using View and Entity Reference View Widget Checkbox

Basically i have a field (in line item(commerce custom product)) with Field type: Entity Reference and Widget:View. The view is a list of terms and has an aditional field type:Entity Reference View ...
0
votes
2answers
23 views

How can I add custom markup with a theme function?

I have a simple form as follows function MY_MODULE_form($form, &$form_state) { $form['MY_MODULE']['message'] = array( '#type' => 'markup', '#markup' => 'My Heading', '#tree' ...
0
votes
0answers
16 views

Drupal menu calling variables in the template

When I use these functions it gives me a permanent redirect error on the code whereas when I use other page callback it does not give me any problems. function kbc_menu() { $items['hello3'] ...
0
votes
0answers
19 views

How to send result to a theme form

Here is what I am looking for. I have a hook menu which calls a themed form to enter details. I have another hook menu which calls the records in a tabular form. Now what I want is to add a link to ...
0
votes
2answers
30 views

Use CAPTCHA module on a custom HTML form? (no use of Drupal Form API)

Is it possible to use the CAPTCHA module on a custom HTML form created in a content page of a Drupal 7 site? I am not using the Drupal Form API or webform modules. The form has the following code: ...
0
votes
2answers
39 views

How to make submit button work in form themes

I am trying to create a form which calls an external template file to format the form but ended up into a typical issue. This is what I was doing. I created a hook menu and called a theme, in the ...
0
votes
1answer
27 views

Enable/disable a menu item programatically depending on a variable value

I need to show a menu item only in certain moments. Imagine that I've a form with some options. If 'A' is selected, I need to enable a menu item that has a form for adding information about 'A'. I ...
0
votes
2answers
63 views

Drupal 7 - create own login form

Is it possible to create own login form? I need to insert it into my basic page. It is campaign for my client and he wants to be able login from specific basic page. I have tried to use block from ...
0
votes
2answers
19 views

Change the add content look and feel for an specific content type?

So, I would like to change how the Add Content form looks like. Right now the user sees it like this (everything's in spanish, sorry) But I would like to change it to something like this (all text ...
0
votes
2answers
26 views

How to output content to a page

I have a form on my page that is being submitted. I am implementing hook_form_submit and within that function I have a search algorithm that processes the entered data and returns a result. I would ...
0
votes
1answer
18 views

Panels - build own dynamic layout

Does anyone has any idea how to create own custom dynamic layout for Panels3? What I mean by dynamic is that I want to create 1x2 grid and have an ability to add new rows with "Add new row" button. I ...
1
vote
1answer
41 views

Strange problem with autocomplete field in forms in Drupal 7

I have an autocomplete field, which has been working perfectly for 1-2 days. Suddenly, it stoped working. I re-wrote the code, cleared the cache, and it works again. After comparing code, it is ...
0
votes
0answers
22 views

How can I split the User name and password group in the register page?

I want to split the User name and password group in the register page into separate fields but they are wrapped into "<div id="user_register_form"><h1>Register</h1>..." The open ...
0
votes
0answers
30 views

Drupal 8- i want to pass parameter(id) in routing form(_form) and buildForm method in the class( &$id = NULL)

This is the class TestForm : public function getFormId() { return 'test_form'; } public function buildForm(array $form, FormStateInterface $form_state,&$id=NULL) { $id = ...
0
votes
0answers
25 views

How to customize survey builder form by programatically in drupal

I have installed survey builder module. Using this we created survey pages, but form elements are not aligned properly. I want to give some style to survey form elements. How can i make it is ...
0
votes
0answers
18 views

How to programmatically save a form with it's default values/state

What is the easiest way to get $form_state and all it's default values? It only needs to contain the default settings that are loaded from the variables I already set. I'm trying to manage theme ...
0
votes
2answers
21 views

Form select type: setting default based on options' value

So I've got this form: $form['color'] = array( '#type' => 'select', '#title' => t('Kleur'), '#options' => array( 0 => t('Wit'), 1 => ...
0
votes
0answers
36 views

Image / File AJAX form fields not saving

I built a AJAX form so that users can setup their user profiles after logging in. All basic text fields work/update fine. But I can't for the life of me get a image field (Picture) or file field (PDF ...
0
votes
1answer
16 views

Problem embedding user_register_form in custom template

I need to embed the user_register_form inside a template. In my module i do: .... $form=drupal_get_form("user_register_form"); unset($form["field_nickname"]); unset($form["locale"]); ...
0
votes
0answers
17 views

Webcam Plugin Doesn't Work in my Drupal 7 Forms API

I've been developing a module that must have a capability to capture a user's profile picture. This is what my interface looks like: Where in fact it should be like this: (sample.php) Webcam ...
0
votes
1answer
16 views

Drupal forms, how to output content of a date (array)

I have a form made with the Drupal Form API, there is a date field which result I want to output to the user in an email. I'm only getting array as output, so how do I access the keys and values? ...
1
vote
3answers
23 views

Multiselect values not getting saved in hook_settings()?

This is the code I have implemented in my module which is working fine! /* * This is a helper() */ function MYMODULE_feeds($page_id = '') { foreach($pagefeed['data'] as $feedval) { ...
0
votes
0answers
39 views

Use a collection of form inside a single form (as Symfony2)

I would like know if it's possible in Drupal 8 to have forms inside form. The perfect example is inside Symfony2, it's possible to use a field called Collection and return a FormType to have a ...
0
votes
1answer
22 views

Insert my files inside a custom table after upload?

How to insert my uploaded files inside a custom table (as managed_file) after upload inside a custom form on DRupal 8 please ? For moment, I have : $form['images']['new']['local'] = array( ...
0
votes
1answer
29 views

Removing field wrapper in a form

I would like to theme a form, and the div wrapping my text input element prevents me from doing what i want. So i got this right now : <div class="form-item form-type-textfield ...
0
votes
0answers
23 views

Open a Browse Dialog for Image Upload when a context menu is clicked in Drupal 7 Forms API

I've been developing a module that must have a capability to browse and upload a user's profile picture. Before I was using a managed file form control to browse and upload a picture but as time goes ...
1
vote
1answer
16 views

Adding a button to a form that links to an external URL

I am trying to add another button to a user login form. I am able to get the button to show up, but not to link to an external URL (example.org in the code below). Code I am using is below: ...
0
votes
0answers
17 views

Webform form results into same form in result page

I am trying to create webform with custom result page. In 'Form settings' page I set Confirmation page and in confirmation message insert my php code. Here is code: <?php ...
0
votes
1answer
15 views

How do I know Honeypot is working on my custom module form?

I have a custom module that renders a form. In hook_form_alter() I have added honeypot_add_form_protection($form, $form_state, array('honeypot')); Though, when I perform 'Inspect Element usnig chrome ...
0
votes
1answer
21 views

Identify form control id in Drupal 7 Forms API

does form controls in Forms API have id's? Below is my sample code: function myid_user_page_form(){ $form = array(); $form['id'] = array( '#type' => 'fieldset', '#title' ...
0
votes
0answers
14 views

context condition for field group multipage

I have a node form configured with field group multi page, my node form is outputted as a block on the front page. I want to disable(hide) the rest of my front page blocks when the user is on the ...
0
votes
1answer
23 views

Override submit function in Drupal 8

How can I override the submit function in Drupal 8? (alter the submit function) I tried adding this to my hook_form_alter: $form['#submit'][] = 'mymodule_form_submit'; but it doesn't goes into the ...
0
votes
1answer
16 views

I can't remove an manage_file field image

I have the next managed_file field: $form['portada_field']['imagen_portada'] = array( '#title' => t('Imagen'), '#type' => 'managed_file', '#description' ...
0
votes
1answer
12 views

Add a Canvas Form Control in Drupal Custom Module

Im currently developing a module and I have this code in html: <canvas id="cnv" name="cnv" width="500" height="100"></canvas> I want it to add in my page using form controls but when I ...
0
votes
0answers
20 views

Having trouble selecting elements in jQuery with JS added on the form

I have a form with a file element and a button. When I click the button it is supposed to run some JS. I have tried three separate ways to get this to work but each way gives me a different result. ...
0
votes
1answer
25 views

Changing color of form html with Javascript

I have some custom HTML and CSS added to a form module I've created. It looks fine; the css is styling it correctly with a drupal_add_css() stylesheet. But I also want to add some Javascript using ...
0
votes
1answer
19 views

confirm_form redirect to referrer

I have few confirm_forms which could be invoked from different places. I would like to redirect user to proper place after cancelation. REFERER Header is not good way to do it so I'm looking for good ...
0
votes
2answers
29 views

Impossible to get my pager

I need to show in the same page a form and a table which shows all results from a webservice response. function collectivite_search_user_form($form, &$form_state) { $form['name'] = array( ...
1
vote
0answers
35 views

Ajax form works on page but not on block

I've created an ajax form with drupal API. The ajax functionality works if I render the form on a page with hook_menu, but it doesn't when I render it in a block. This is how I create my block: ...
0
votes
0answers
13 views

Module to have people enter text in an on-page “pop-up” box when clicked on a <span>…</span> (already having a JS function) — and save their input

I am looking for a module that allows certain users to enter text when clicked on the text-contents of a <span>...</span>. In my case the <span>'s automatically start an audio file ...