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

learn more… | top users | synonyms (1)

1
vote
0answers
10 views

Why are my Simple Hierarchical Select fields not opening in multifield edit form?

My User Registration form has a multi field. In the sub fields, I have used term references as simple hierarchical select. As I need adding new value option as well. Data is added through these ...
1
vote
0answers
13 views

Warn user before leaving web page with unsaved changes [duplicate]

I have some pages with forms in my application. How can I secure the form in such a way that if someone navigates away or closes the browser tab, they should be prompted to to confirm they really ...
1
vote
2answers
19 views

Show alert when user navigate to other page without filling the form

I have a form created by custom module.Now i want to show an alert("PLease fil the complete form before navigating otherwise lost all the data") if the user navigate to another page without filling ...
0
votes
1answer
9 views

Making the size of two fields in comment form the same programmatically

in my node comment form I have a 'your name' field and an 'email' field for users to fill out. They are different in length and like them both to be length '30'. How can I do this with ...
1
vote
0answers
14 views

Prepopulate the field twice

I'm using Entityreference Prepopulate module, but I'm wondering is there way to prepopulate the field twice or more than once. Example: www.testsite.com/add/node/custom&field_venue=92,92,92,183 ...
0
votes
3answers
25 views

How to set default value for textfield programmatically in drupal 7?

I need a form_alter code or something that I could use to set my field value. I'm getting the value from the parameter and I've tried a lot of ways but nothing works for me. This is the list of codes ...
0
votes
0answers
13 views

Add custom file field upload button

I'm adding a custom video file field to a content type. I use the hook_widget_form to add the file upload fields, but there's no submit input. I'm looking hook_form_alter to add the upload input and a ...
0
votes
2answers
27 views

Drupal Form in Block will NOT call Submit or Validate handlers

Let me start by saying I have seen quite a few similar threads, and I have tried everything I've found so far, with none of them working. My brother wanted a contact form to be in the footer of his ...
0
votes
1answer
26 views

How to create form on users account page?

I used hook_user_view_aler() to add some info to user's page. $account['summary']['member_five'] = array( '#type' => 'user_profile_item', '#title' => t('I do'), '#markup' => ...
0
votes
0answers
13 views

Changing configuration using form

I have created a form using which I want to make changes in the configuration.Currently I am submitting form doing something like this: public function submitForm(array &$form, ...
0
votes
1answer
16 views

How can I remove “please wait…” from a form?

I saw this Remove the "Please wait" text on Ajax Call but I can't find the form element. <?php dsm($form);?> and <?php dpm($form);?> return errors. This is what I found in $node: ...
0
votes
0answers
8 views

CKeditor ignore height (rows) when displayed into vertical tab

When CKeditor is included into vertical tab (not the firstly visible tab) the height size is calculated from the container (tab) and ignore the rows attributes from the textarea. What's the good way ...
0
votes
1answer
19 views

Immediately check if field content already exists in a node form

I am struggling with a problem which I thought might be answered simply... Any help would be appreciated! I have a content type called 'review'. Each review has a field called 'location'. As a user ...
0
votes
1answer
9 views

Ctools modal_form not working with webforms

i have been trying all morning to get my webform to open up within ctools modal_forms popup window. i’ve tried everything, but nothing has worked so far. the module is working no problem. this form ...
0
votes
1answer
24 views

Submit not executed

Why is my submit function never been executed? /** * Implements hook_menu(). */ function simpleexample_menu() { $items['simple-example-page'] = array( 'title' => 'Simple Multi-Step Form', ...
0
votes
1answer
13 views

Adding background color to table rows

I was wondering if it is possible to change the background color of a table row. I want to display certificate files, and if that certificate is going to expire in longer than 30 days the color green ...
1
vote
0answers
31 views

How can I find which modules alter my form?

Is there a way to debug the list of modules which alters my form (using form_ID). I can get a list of modules implementing hook_form_alter using module_implements('form_alter') but how can I know ...
0
votes
1answer
23 views

Embed form within a form

I am building on an existing site, adding / modifying functionality to it. There is a form, which is a part of a (sort of a) multi-step form which I need to alter, and add another form to it. So, I ...
0
votes
0answers
22 views

Reuse form from another module in multistep form

I have built a multistep form, and it works fine. Now I have installed LoginToboggan module, It has the option of show a unified login/registration form. I would like to set the last step of my ...
0
votes
0answers
16 views

DRUPAL 6 Dependent Drop Down?

i need to create dependent drop down like, if i select drop down one then automatically load related list in second list through ajax call, using change event. But there is option in drupal 7 like ...
0
votes
0answers
21 views

How to upload images in form - Drupal 6 [closed]

I want to create a form with 2 fields for uploading 2 images. I have read some examples on internet and doing everything by them. Problem is that the form is acting like there are no files selected ...
0
votes
0answers
18 views

Drupal 7 form only submits when logged in

I've built a form with Drupal 7 FAPI and it works perfectly, but only when I'm logged in as an admin. Otherwise, if you try to submit it without being logged in the page just refreshes when submitted, ...
1
vote
0answers
18 views

Programmatically loaded taxonomy form ajax errors

I load a taxonomy term in the edit form via the following code: module_load_include ( 'inc', 'taxonomy', 'taxonomy.admin' ); $vocabulary = taxonomy_term_load ( $tid ); $form = drupal_get_form ( ...
1
vote
2answers
67 views

How do other modules update elements using AJAX callbacks?

I have a block, of which I want to update the contents via AJAX. So the block is: $block['subject'] = t('My Block'); $block['content'] = '<div id="block_wrapper"></div>'; And the form ...
1
vote
1answer
64 views

Using hook_form_alter on an existing form element in Drupal 7

I'm using the Commerce module and in the checkout process I'd like to change the size of one of the input fields. I'm trying to use the following code but it doesn't seem to be working. Am I doing ...
0
votes
0answers
11 views

The array $form_state undefined with ajax

Why when I submit form generated with ajax, the array $form_state is undefined? this is a part of module: 1) $form['#tree'] = TRUE; $form['addTel'] = array( '#type' => 'submit', ...
3
votes
1answer
36 views

How can I draw a donut chart based on the number of specific fields on a form?

Is there a module that can count results in a form, and then draw a donut chart like the following picture? Note that I'm actually using content types and Views to create such forms (so I'm not ...
3
votes
1answer
27 views

Grab Data from non form elements and send as POST using AJAX

I am looking for an alternative solution to the way my form is being submitted right now. The problem is that the validation function does not work because I gave the submit button on the form an ...
0
votes
1answer
20 views

How i can add a new line in my code here?

HI guys go to THE TEXT THAT FOLLOWS I WANT IT IN NEW LINE and help how to separate that text in 2 lines $form['kkkkkk'] = array( '#type' => 'textfield', '#title' ...
0
votes
0answers
27 views

Remove button field of a field generated by AJAX

This is my custom Drupal module. I have a form containing text fields, each with a button to remove the field from the form. The problem is that the remove button always removes the last field, ...
1
vote
0answers
15 views

How do I load the $form_state for a form loaded with drupal_get_form?

Or is drupal_get_form not the right way to go about loading node forms where I want to also get the $form_state? The reason I am asking is I would like to be able to place multiple node forms on the ...
1
vote
2answers
28 views

Get Div's Text in Drupal Forms API

I have this code below: $form['id']['mypreview_modal'] = array( '#type' => 'item', '#markup' => '<div id="mypreview_modal" title="ID Preview">12345</div>' ); ...
0
votes
0answers
21 views

Multiple Fields Custom Form not saving default values?

I tried to create multiple fields with values on it using custom form which allow users to add data as many as possible. and then I can populate from there, but I tested submit and the default value ...
-3
votes
0answers
24 views

Checkbox with key as 0 unselected automatically

as you can see in my question In my checkboxes if i have a 0 value it select this checkbox i solve my problem but now if i select emergency with key == 0 it also unselect this checkbox any ideas??
0
votes
0answers
12 views

Drupal put more values in #markup $form type [duplicate]

Is it possible to add more values into the #markup of a drupal form? At the moment it is a link but I also want to add an image. When I add another #markup it only takes the last one, and when I add ...
0
votes
0answers
7 views

How can I get the functionality of the search page form in a block?

I'm using this right now to get a search form in the page header <?php $form = drupal_get_form('search_block_form', TRUE); ?> <?php print render($form); ?> However when you go to the ...
0
votes
2answers
14 views

Configuration form settings

I would like to create a settings page for a user which allows them to save the options of a list which is to be used in a custom form. The list is called marketing source and it is added to a form ...
0
votes
0answers
16 views

How to hide row cell when using table in forms?

I have a field widget that has multiple values per field and some are values or other form types that do not render any visible data. I want to use the table element to encapsulate these fields into ...
0
votes
1answer
19 views

Page arguments - hook_menu

I have this two test menu items: $items['test/%id'] = array( 'title' => 'Test', 'type' => MENU_LOCAL_TASK, 'page callback' => 'drupal_get_form', 'page arguments' => ...
0
votes
1answer
17 views

Create a secondary form to fill data into an entity

I've an entity that models a contact (I'm using RedHen CRM) and obviously I can fill the data from the usual admin form. But if I want to publish another form for non admin users to insert their data ...
0
votes
0answers
19 views

I have a huge problem with the form

I want a form with checkboxes that will have all the severity levels and when the user (e.g selects only the error i want to select only the errors from watchdog. My problem now is that in watchdog ...
0
votes
1answer
14 views

how to customize Registration form

How to add a fields into custom registration form in drupal7 and how to give the link so that annonmous user can register.
1
vote
1answer
28 views

Custom form module

I have created a custom form named user_form_expiry, how can I access that form from the admin panel similar to other Drupal's built in forms like user_register_form?
0
votes
3answers
33 views

How to find the default value or change state of a Drupal 8 form element?

I'm putting together a fairly complex form with Drupal 8 (currently building on beta 7). In my validation function, I need to be able to detect whether a field, which was populated with default ...
0
votes
2answers
34 views

Creating node and user with one form

I have a content type, 'A'. Now I need a form with the user registration form fields plus the 'A' creation form fields. So when the user (annonymous) submits this form, a user and a node of type 'A' ...
1
vote
5answers
159 views

How can I disable a form's default validation functions?

I have created my own validate handler: /** * Validate handler. */ function my_module_validate($form, &$form_state) { $values = $form_state['values']; if ($values['type'] == 'line') { ...
0
votes
1answer
14 views

Preventing Authors from entering pre-formatted text into filtered html field

I have a form for my authors to use when entering records. The form has a 'filtered text' description field that also use WYSIWYG. I'm noticing that some of my authors enter 'bad' text. What I mean ...
0
votes
1answer
16 views

How to change “New content” text in entity connect autocomplete edit/add buttons?

using entityreference autocomplete widget (field-widget-entityreference-autocomplete) with entity connect I have the buttons "New content" and "Edit content". How can I just rename them in "New" and ...
0
votes
0answers
29 views

Anonymous Usernames

Good day to you! I want to let anonymous users create content on website. But when I allow them create some node type, I noticed that they cannot specify their username. I can add new field for ...
0
votes
1answer
23 views

Clean url for custom query parameters

I have a custom filter form in my site and the form submitted by the filters adds 2 Get variables to the url. However, the variables appear in the form of: ...