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

learn more… | top users | synonyms (1)

1
vote
0answers
9 views

Commerce multi-select membership donation form

Something like this using Drupal Commerce? You select from a select list multiple options of which everyone has a price right? And so it adds it as a total below in a field like a cart, but in a same ...
0
votes
0answers
6 views

adding data attribute to option value in Drupal 6

I have a form, like this: $form['my_case_type_list']=array( '#type'=>'select', '#title' => 'Issue Type', '#options' => $my_list, ...
1
vote
1answer
21 views

How to add html to the form?

I am creating a custom module. I have a form that I would like to add some HTML to, but I don't know what the best way to do this. In this example, I have a page with a textbox, dropdown list, and ...
0
votes
0answers
11 views

Running code only once when building a form

I have built a form using the field API. The function hook_field_widget_form gets called for every field. I have a bit of code that populates a select box but it is being called for every field in the ...
1
vote
1answer
23 views

Embed a collection of form inside a form

With Symfony2 I can embed a collection of form inside an another form (subform inside form). http://symfony.com/doc/current/cookbook/form/form_collections.html I would like know if it's possible ...
0
votes
2answers
36 views

Make form to show multiple field widgets with predefined values

I have a node form with multivalue field (cardinality unlimited). I need to show user 3 widgets if this field with predefined value (like shown at screenshot). At screenshots I show the current form, ...
0
votes
2answers
22 views

Safety of letting user define javascript paths in fields

I have a module that uses the Fields API to insert a HTML5 canvas element and allows users to define paths to user scripts to be loaded with the page: The scripts are relative to a hard-coded path ...
0
votes
0answers
36 views

Prepopulate field collection programmatically

I have a content type with field collection field (unlimited cardinality). Each collection has image field (required) and long text field. How can I prepopulate node form with multiple collections? I ...
1
vote
1answer
28 views

Get Template Variables in my Custom Module

I am new in drupal. I am trying to get a variable from a template file e.g. maintenance-page.tpl.php and want to get $title variable in a form e.g. admin/config/development/maintenance form. This form ...
0
votes
1answer
19 views

Built-in AJAX versus custom AJAX

As the title suggests, I would to know what are the pro and cons of use Built-in ajax of drupal compared to a custom ajax code. I created 100 <li> with images on a page through a callback ...
1
vote
1answer
21 views

How to create widget element with unlimited values?

I have a widget for a field as shown below: I would like to make the text field ('script_paths') an unlimited value so that the user can add as many as they like. Is there a way to do this? Maybe ...
0
votes
0answers
5 views

Non selected option text in date_select field impossible to set

I am trying to get the unselected option for a date_select field in a form, and if I use #default_value as empty string, it renders the text: " - Month -". If I don't use #default_value, it gives an ...
0
votes
1answer
22 views

Drupal Date Popup - Disable Selects, Display names only

I am looking for a way to remove the select dropdowns from the datepicker popup and only display the names of the months (and the year). As for the appearance it can be altered in datepicker.1.7.css . ...
1
vote
2answers
38 views

Attach an #ajax callback to a field when the form is reloading from previous ajax request

Is it possible to attach an #ajax callback to a field when the form is being regenerated from a previous ajax event (like a submit button)? What I tried Adding the #ajax callback to the field ...
0
votes
1answer
10 views

Drupal 6 Form fields not displaying if nested too deep.

I'm using Drupal 6 to create a form that's pretty big. Basically here is how the client wants this form to act: Users create engagements, and an engagement can have multiple goals and multiple ...
0
votes
1answer
46 views

Generate a new form

I want to insert a form element (type = 'select') into an EXISTING page. Normally we would use define a new page with a page callback, the page callback would then call drupal_get_form. In this ...
0
votes
0answers
13 views

Generate and include a form in a custom admin template

I have spend six hours, I am stuck on a problem. I try to create a custom admin page for my module. For this, I use the hook_menu in which I have pass the name of a method in the argument ...
0
votes
1answer
15 views

Can't get jQuery UI autocomplete working

The text field that is created seems to just act like a normal textfield, no autocomplete function or any indication that it works at all. There's no errors in the console. I've run checks to see if ...
0
votes
1answer
28 views

Theming / modifying the markup of default search block form

I'm trying to modify the basic search block form that comes with Drupal 7 core. I have a custom theme and inside my templates folder I copied the search-block-form.tpl.php and modified it like so ...
0
votes
0answers
14 views

Expose multiple custom forms to views

I would like to create several "calculators". These consist of a page with a form which will perform calculations and provide results in a table. There may also be messages triggered depending on ...
0
votes
1answer
9 views

Drupal 7 trim user input and other checks to prevent security issues

What is the recommended way in Drupal to perform trim and other checks before accepting user input to avoid sql injections and other similar security issues? Thanks.
0
votes
0answers
18 views

How to Get Orgainic group request form to load additional fields

I have created two different types of groups and one of them was made by cloning another. The first group type I created is for starting a grand jury group. The request form includes name, address, ...
0
votes
1answer
28 views

Custom Password validation on Drupal 7 form

I am using the Drupal Form API for a customized Login System. It has the password field which needs to be validated. We have a custom criteria of Uppercase, Lowercase, numeric and special characters ...
0
votes
1answer
44 views

hook_form_alter isn't working

I've been trying to insert a placeholder for my search-bar, so in my page.preprocess.inc I call hook_form_search_block_form_alter(), then specify the form's array, and create the placeholder array, ...
0
votes
2answers
30 views

How to alter a form's name attribute

I'm trying to override the Drupal Login form. I have been able to unset and modify pieces of it, but the last thing I am struggling with is the name attribute on the submit button. Currently, the ...
0
votes
0answers
9 views

Drupal Form with Note datagrid that allows additional notes

I have a registration form that requires my client to manage it through an application process where this client may have multiple contact with the person submitting the form. As such, the client ...
0
votes
1answer
12 views

how to add an alt tag to a form submit button on drupal form

I have a button defined as below, but how do I add an alt tag ? $form['submit'] = array( '#prefix' => $footer_text, '#value' => $search_button.' >', '#type' => 'submit', );
0
votes
0answers
16 views

Hierarchical select list using AJAX on Address Field form not updating

I'm using a custom module with an Address Field plugin to pull Address Field fields from a web service. The first bit is working (pulling a towns list) but I want to have a hierarchical select list ...
0
votes
1answer
25 views

Webform with File upload field throwing “… field is required” error

I have created a Webform, which has two file fields (i.e. Attach document 1 and Attach document 2). Both of them are mandatory and files are to be uploaded in the "Private" folder. Now when someone ...
0
votes
1answer
12 views

How can pass a data of a node's field to entityform field

I have a field named "code". This hidden field stores some alfa_numeric values. Nodes with using this data field have an entityform type as a block in page. How can I pass node's data values to ...
0
votes
2answers
22 views

Adding JS to a form within Omega 4 theme

I need to add some JavaScript to forms within my Omega 4 theme. My code right now is: function mytheme_preprocess_form(&$vars) { $vars['element']['#attached']['js'][] = 'path/to/myjs'; } ...
0
votes
2answers
23 views

Email validation on Drupal 7 default form Api without installing any modules

I am using Drupal Form API to create forms. What is the way to add email address validation without having to install any separate modules? Thus I am just looking for out of the box functionality. ...
0
votes
1answer
53 views

Autofill texfields based on select option in dynamic fieldset

In my custom form i am dynamically generating multiple fieldsets.Each field set has select option(dropdownlist) and textfield generated dynamically. The value for textfield is dynamically generated ...
0
votes
0answers
11 views

Duplicate ids in submit elements when form loaded via ajax

I have a page that uses a form (form 1). A user interacts with the page and javascript loads a second form (form 2) as part of this. So now we have two forms on the page, in separate places in the ...
0
votes
0answers
20 views

Illegal string offset 'pass1' in form_process_password_confirm()

I am creating a installation profile with default user id and password. Whenever I set password for my user I am getting two warnings. Warning: Illegal string offset 'pass1' in ...
0
votes
1answer
18 views

form from drupal 7 page not opening new page

I need to open a new page from a drupal page when it is an android , so I made a form like this <form target="_blank" name='myform' ...
0
votes
0answers
17 views

Exposed filters not working in form

I am having a strange problem. I have created a block type of view which has an exposed filter with it. I have embedded the view withing a form like this : $form['attached_content_holder'] = array( ...
0
votes
1answer
22 views

How do I build a form with embedded view results

I need to create a sign up form that also displays all of the submitted values above each value on the same page. I have searched for hours and cannot find anything that describes how to achieve ...
0
votes
0answers
17 views

How to prevent the comment form from redirecting?

I have a page with a View listing comments; the comment form is also in this View. After submitting through the comment form I get redirected to the actual comment, however I would like to stay on the ...
1
vote
1answer
65 views

A Multi-step Form to display Database Data at the End

I'm fairly new to Drupal but I'm building a site using Drupal 7. Most of the stuff is pretty standard Drupal things, but one of the things my stakeholders want is a tool that does the following (and ...
0
votes
1answer
22 views

Creating checklist form programatically

I need to create checklist form(s) comprising of a different sets of checks with different ways to enter an answer. The end user (who will prepare checklist) should not need to add fields to the ...
0
votes
2answers
37 views

Alter a field by select list in entity form

I have a problem with Ajax and some fields in my entity form. i have a select list in my form and when i change the selected option i wanna increment another field. To explain better, i can create ...
0
votes
0answers
11 views

commerce kickstart add to cart button missing after reset

We've been testing Kickstart 2. I hit the Reset function and re-installed without demo data. I enabled all options -except- the 'Allow Anonymous Users To Access Cart'. Using the default ...
-1
votes
0answers
22 views

append new form with ajax_command_append

My task is to add multiple forms to a page, with a simple select. Eg: user selects an option in select and based on the selection, i need to add new form to the page. I wanted to do this with ...
1
vote
0answers
23 views

Drupal Rooms - How to render the “Book This” form in a node reference full description?

I absolutely love this module, it works great and is exactly what I am looking for. I am hoping to extend the functionality so I can render the "Book this" form on a referenced node rather than the ...
0
votes
2answers
40 views

Adding a validation handler to the registration form

I have altered the registration form to change the thank you message and add the validation of some fields. function mymodule_form_alter(&$form, &$form_state, $form_id) { if ($form_id == ...
0
votes
0answers
62 views

Inserting custom social media icons to nav.bar ( tb-megamenu )

I have been playing around all day and have been trying to get my social media in my navigation bar to the far right for people to click on and be directed to my social media account. I am using tb ...
-1
votes
1answer
25 views

how to alter only one set of specific forms?

Consider I have 3 content type. The problem is that if I use form alter in a module , when I use: drupal_set_message(t($form_id), 'status', FALSE); in the mentioned hook, it shows me different set ...
0
votes
1answer
12 views

How to upload multiple files and predefine filetypes?

Does someone know how it is possible to upload multiple files with the dropbox client module for drupal 7? It would be nice if it could be integrated with plupload. Also i would like to know how i ...
-3
votes
1answer
37 views

hi I'M not getting the textfeild druing module development [closed]

$form['companydetails']['contact name']=array( '#type' => 'textfeild', '#title' => t('Contact name'), ); this is my code but I'm not getting textfeild infront f contactname attribute....im ...