Forms are the primary method for obtaining and acting upon user input in Drupal.
0
votes
1answer
10 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
12 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
23 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
15 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
23 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
10 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
11 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
10 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
14 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
18 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
8 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
20 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
15 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
0answers
12 views
Overwrite Form Control in Drupal 7 Forms API [closed]
I have three form controls in my page: fieldset, item type and a managed file.
function myid_user_page_form(){
$form = array();
$form['id'] = array(
'#type' => 'fieldset',
...
0
votes
0answers
6 views
Make a context menu after clicking a button in Forms API [closed]
Hi I want to achieve something like this. When I click the button below:
A menu will appear like the image below:
I dont have any idea what form control shall I use to achieve this. Any idea?
0
votes
1answer
9 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
16 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
18 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
18 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
26 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
28 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
12 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 ...
0
votes
0answers
17 views
Custom register form and default register form
I have a custom module that alters the default form. It's a multistep form, lot more other details, web service xml posting and getting details etc.
The thing is here, now I'm using the Services+REST ...
0
votes
0answers
13 views
How do I build a form to filter nodes (like exposed filters in views)
I am very familiar with using exposed filters in views but have finally decided it's time to write my own module as the exposed filters aren't offering exactly what I require.
I have a list of ...
0
votes
0answers
12 views
Custom Add page
I need to create a custom 'Add' and 'Edit' pages for specific content type, with some entity reference drill down behaviours.
I'm trying to override the add page like below with my form within it, ...
0
votes
0answers
28 views
How to dynamically remove field in custom form using AJAX
Based on the "Add-more button (with graceful degradation)" example available in Drupal examples module I have created a form that can add fields dynamically using AJAX, and now i want to add a ...
0
votes
0answers
9 views
VBO Pass Argument to Custom Action Function
I have a view that list entities. It has a VBO field on it for executing a few custom actions.
I can get the actions working, but I need to add a field to the operations form on the view which lets ...
1
vote
1answer
12 views
Adding accept attribute to managed_file field to specify file types client-side
I've got a file field in a custom form like this:
$form['image_upload'] = array(
'#type' => 'managed_file',
'#title' => t('Image upload'),
'#description' => t('Upload png ...
5
votes
1answer
65 views
Remove filter formats help text
In D6 and D7, with a simple form_alter you could unset $element['format'], but now the format help and the format tips are added in a #process method.
How can I remove them?
0
votes
0answers
7 views
How to create an edit form for admin input
I would like to create from a module an add/edit form.
For now I made an add form that looks like this:
$form["locationTitle"] = array(
'#type' => 'textfield',
'#title' => t("Vietas ...
0
votes
0answers
16 views
Title not showing up on Form
I have the following code and for some reason my title is not showing up on the form display. I've tried flushing the caches a million times, clearing my cookie cache, and refreshing the browser and ...
0
votes
4answers
54 views
Where do I put and How do I use form_state['redirect']
The documentation says to put $form_state['redirect'] in your code when you want to send the form to a new page. However, when I use it in the third page submit handler of my multi-page form it ...
0
votes
2answers
35 views
My php is showing a numeric value for my list field…Why?
In a form I'm trying to take a value a user selected from a radio button and compare it with what's in the database. The value for the radio button is stored in $form_state['storage']['level'].
The ...
0
votes
0answers
13 views
Create a registration form
I've already customized the default user_register form with hook_form_register_form_alter().
That form is using complex multistep form and connects with a web service for validating etc.
Right now I ...
0
votes
1answer
23 views
how to make URL aliases of nodes created via form include node title of original page?
Say I have a content type called "X", and every node of Content type "X" has a form that will create content type "Y"
How do I go about setting up the URL alias of content type "Y" so it will be ...
0
votes
1answer
23 views
How can i create a new page template for user registration page
I am a beginner in Drupal. I need to create a new page template for registration Page . Because in my website almost all pages have different layout.
Currently all pages are rendering through ...
0
votes
0answers
16 views
How to get submitted form value inside hook_preprocess_hook() in Drupal 7?
I have a management module which consist of two theme pages[much like the core Search module],
management-block-form.tpl.php: for showing the form and
management-table.tpl.php: for showing the ...
0
votes
0answers
12 views
Adding a styled progress bar under Form Title but above #prefix text in Custom Module
I have a multi page form. This form has a title set in the hook menu function at the top as they are wont to do. It displays the title of the form, with this code:
'title' => 'The Tool',
I then ...
0
votes
0answers
18 views
Can't replace page content on node from ctools modal
I have a custom field formatter on an Event node that displays data from a multifield in a simple HTML table (the multifield has a user entity reference field and a text field that contains a number ...
0
votes
0answers
10 views
How to attach an event to manually added form fields
I am using Ajax to change the values of some selects, I actually do replace the old select with the new one, but unfortunately the on change event is no more available, even if I manually added the ...
1
vote
1answer
14 views
Form inputs being disabed during the Ajax request
I'm working on a module where I have a form inside of a block, I'm using Ajax to submit the form, but I noticed that the form's inputs are disabled when sending a request with Ajax. Well in my case I ...
0
votes
1answer
17 views
Combine Token title with url in an email
I send emails automatically to users. There is a link in these mails, which points to a node. But I want to use the node title as an alias for this link, so that the link is not directly displayed in ...
0
votes
1answer
10 views
Form Permissions not working in Module with Multiple Forms
This works great in a module with a single form, however in a module with multiple forms the form does not show up in the permissions list. Is there something that I need to do differently for modules ...
0
votes
0answers
33 views
why is my autocomplete not working?
i'm working with groups and users, and i would like to display only the users that are not already in a group to prevent errors while writing the name of the user.
Here is the menu :
...
0
votes
1answer
51 views
Displaying Database Data Within the Flow the Site
I have a multi-page form that works fine in and of itself (pathfindertool.module). However, once a user clicks submit I want the page to display some records on the page. And it DOES display the ...
0
votes
1answer
29 views
Can we add a new column to field collection in edit form?
I created a topic before with this question, but i write another to be more exact on what i want to do. I have an entity with several field collections and in this field collections, several fields ...
0
votes
0answers
73 views
Dependent multiple selection drop down in drupal form - illegal choice error
I'm new to Drupal , in my project I have 2 multiple select drop down box. I don't know how to do dependent multi select drop down action in drupal form alter function using ajax.
Single selection ...
1
vote
2answers
31 views
Call a function in JS file from drupal
I have included a javascript in the module "myid" I've been developing in drupal by using this code:
function myid_init() {
drupal_add_js(drupal_get_path("module", "myid") . "js/myid.js");
}
...
0
votes
2answers
11 views
Expose the user form into a page
I've been thinking for a user-friendly navigation into my website.
I wanted to exposed the user form into a page where they can just easily update their information. I've installed the module profile ...
0
votes
1answer
17 views
Create and pre-populate a mutiple value field in field collection on new node with ajax call
This question is in the same area as a previous I asked (How to create (& pre-populate) multiple “field collection” fields on an ajax call), but with the extra level of complexity that I'm trying ...