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

Submit form and display confirmation page in ctoosl 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
14 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
17 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
19 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 ...
0
votes
0answers
7 views

file content should be placed in textarea based upon the filename selection

I have listed filename in select options,if i select any one of the file ,the content of the file should display it in textarea. function open_admin_settings($form, &$form_state) { ...
0
votes
0answers
8 views

Form api empty value (#empty_value) overwrites index of a select option - how to stop it?

I want to use the empty value ('#empty_value') property of the $form api array for my select list element. My options are keyed as per the PKs of a table and values are the 'description' One of the ...
0
votes
0answers
7 views

Mollom not showing up on custom form

I'm trying to protect a custom module contact form from spam. Following this walkthrough, I ended up with something like: function mymodule_mollom_form_list(){ $forms['mymodule_form'] = array( ...
0
votes
0answers
10 views

Changing field type to text_format via hook_form_formid_alter loses data when trying to edit form

I have a content type named "job posting." On this content type I have several long text fields, but I want to use a WYSIWYG on those fields, and I want to filter the WYSIWYG's HTML. Using ...
0
votes
2answers
26 views

How to add field to ALL webforms?

How do I add a field to all webforms? I have a website where I'm using webform for surveys and I want that on each survey there will be a field that is the same in all of the nodes/webforms. Thank ...
0
votes
0answers
22 views

How to run validation on hitting the submit button for exposed views filters. Currently it runs on first page load

I am trying to add validation errors to exposed views filters (drop down lists) in block region. However, my validation error runs on the first page load before I hit apply button. Also the ...
-1
votes
1answer
16 views

how can i display my custom form in popup in drupal 7? [duplicate]

I create a custom form module.how can I display my custom form in pop-up in drupal 7
0
votes
1answer
19 views

How to set up multiple hierarchy taxonomy?

I am struggling to find the solution for the following situation: I am building a tourism site with POIs as nodes (Drupal 7). The POIs are categorized/tagged in a State-County-City hierarchical ...
0
votes
1answer
14 views

Alter a form based on where it is called from

I am using something on the lines of $view = views_get_current_view(); $build = drupal_get_form("comment_node_contenttype_form", (object) array('nid' => $view-> args[0])); print ...
0
votes
2answers
39 views

Programmatically populate a Drupal form

I am very new to Drupal and trying to write a module. I have 2 entities - Membership and MembershipRequest and both are fieldable. A MembershipRequest is a request to the admin of the website to ...
0
votes
0answers
11 views

drupal_http_request not responding with redirect_url

I have a form like this: <FORM METHOD="POST" ACTION="https://some.url/with/data.asp" id=form1 name=form1> <INPUT type="hidden" NAME="name1" value="value1"> <INPUT type="hidden" ...
0
votes
0answers
6 views

Modifying the properties and output of a select list when adding content with the admin Drupal 7

I have a type of content. Depending on the domain (I use Domain Access), I want to show a different content in a field which is a select list with reference to term. By several reasons, I do need to ...
0
votes
2answers
29 views

call external form in ajax callback

I have two forms (A & B) in custom module. Form A containing three fields(each field is dependent drop down) and Form B containing only one field (markup field to show data). The problem is that ...
-2
votes
2answers
39 views

How i can change page with “next” previous" buttons in the same node

i want create something like that : and after clicking next page , the node doesn't change :
2
votes
1answer
18 views

Hierarchical select ajax conflict in custom bootstrap theme

I have created a custom theme from scratch using twitter Bootstrap. In my content type there is Taxonomy term Hierarchical Select (HS) list. Problem: When authenticated user try to select any term ...
2
votes
1answer
34 views

Making a custom form element AJAX aware

How should I go about making my custom Drupal 7 Form element support AJAX events, just like other standard FAPI elements? For example, with a drop-down list, I would do this: $element['book'] = ...
0
votes
0answers
16 views

Embed a Select Form Control in a Modal

I have a select form control. $form['options'] = array( '#type' => 'select', '#options' => array( 1 => t('One'), 2 => t('Two'), 3 => t('Three') ), ...
0
votes
2answers
19 views

Drupal 7: use Form API to make a button that doesn't submit the whole page [duplicate]

I want a button that runs a callback function using the AJAX method included in Form API. The button I have still submits the whole node edit form. I don't want it to do that - just pass a couple ...
0
votes
1answer
28 views

Embed a form inside a modal

I have a modal in my form. $form['myid_print_preview_modal'] = array( '#type' => 'item', '#markup' => '<div id="myid_print_preview_modal" title="ID ...
0
votes
0answers
7 views

Isolated registration form

I want to give users a chance to sign-up before a website's launch - provide anonymous users with a registration form when they access a site to let them pre register. I am using the Prelaunch module ...
0
votes
1answer
23 views

Re-submit form after confirmed AJAX form

I have a form with submit AJAX button. When clicking this button, it calls function callbackAjax(). In this function callback, I checked a condition A to show a warning dialog if A is FALSE. The ...
0
votes
0answers
13 views

System settings form not saving weight with table drag

I am trying to do a table drag, and the table drag is working, but the weights don't seem to save on form save. Here's my form: function lextext_admin_settings() { $form = array(); $lextext_info ...
0
votes
0answers
10 views

How do i customize the node/add Page and add it to my Content Type?

i want to add a add_node to my content type. i already found that code and it works for me but i wanted to output only the fields that i really needed. <?php module_load_include('inc', 'node', ...
2
votes
1answer
45 views

Display form errors on each field instead of at the top of the page using form_set_error

I use form_set_error to set the error text after validation fields (email, phone, etc.). The validation error messages are show at the top of the page. This also happens with errors for required ...
1
vote
1answer
20 views

create contact form block with prepopulated entity references and send email to content author

I am trying to create 3 forms, 2 of them should be made into blocks to show on specific content types. One for anon users and another for logged in users. The other is just a site wide contact form ...
0
votes
0answers
8 views

How can I make form error messages translatable and custom when using Entityform?

I am using drupal 7 and the Entityform module. And I installed the Field validation for adding validations per field. How can I make form errors translatable and custom?
0
votes
2answers
38 views

How to remove a form after a submit? [on hold]

In my module I have two function : hook_form() and hook_form_submit(); When I submit the form it's working and I display message. But in some of case I need to hide completely the form. So it's have ...
0
votes
0answers
8 views

Theme function not working in module with multiple forms

I have following code for my module it has two forms form-example displayPenCard The following code calls the theme function (theme_form_example_form()) and it gets rendered, which is the theme ...
0
votes
1answer
11 views

How can I remove the descriptions from the registration page programatically?

Using the custom module mentioned here https://www.drupal.org/node/754542#comment-2775706 I was able to remove the descriptions from the user login page. function ...
0
votes
1answer
23 views

entityform email multilingual

I am using drupal 7 and entityform module and also using this : https://www.drupal.org/node/1679794 instruction to sending email after submitting form. the only problem I have is I want my email body ...
0
votes
0answers
24 views

Define custom number of values on unlimited fields

On unlimited value fields a button 'Add more' is used to add an unlimited number of values for that field. Is there any way I could just enter a custom number of values when creating a node as opposed ...
0
votes
0answers
25 views

Redirect to parent node after saving the field collection item

There is a field collection field for a content type, it is called field_item. I gave a direct link to the users to add content to this field based on the it's parent id. this is the url, ...
0
votes
1answer
13 views

Dependent selects in Ctools modal

I am experiencing a rather odd problem in Drupal 7. I have a form in Ctools modal. It should contain 2 dependent select boxes (among other fields). I've done this dozen times on regular forms, but i ...
1
vote
0answers
21 views

Submitting a form causes 'secure connection failed' error that persists

I've got a SSL certified server running drupal 7.37. Everything was working fine until I started adding form submission to a module I'm working on. As soon as I submit the form, I get 'Secure ...
1
vote
1answer
29 views

Redirecting doesn't work with a custom form in a block

I developed a custom form with FAPI and added a block for it. Block is included only on one specific page (basic node). When user submits this form it should redirect user to external site (URL is a ...
0
votes
2answers
22 views

How to Disable Whole Form from hook_form_alter?

I've got a form I want to be disabled when certain criteria are met. According to the Form API I thought $form['#access'] = FALSE; would be sufficient. But no dice. Instead, I'm doing this, which ...
1
vote
0answers
27 views

Form always visible even when radiobutton value is changed (form api)

i'm having an issue with the property #states visible on a form. I want to hide it when form mercuriale's value is 1. $isMercuriale = db_query('SELECT isMercuriale FROM groupes_catalogues WHERE id = ...
0
votes
2answers
22 views

Drupal form submit handler can't print values [closed]

I have created a form through webform module and running a submit handler with the below code. $form['#submit'][] = 'myform_submit_handler'; And in the submit handler function, I'm unable to print ...
1
vote
1answer
29 views

Forms API #states with multiple radios

I've got one radios element: $form['trip_radios'] = array( '#type' => 'radios', '#options' => array( 'new' => t('Create a new trip'), 'existing' => t('Use an existing trip'), ...
2
votes
1answer
25 views

How to re-order user profile form?

I have this code: function mymod_form_user_profile_form_alter(&$form, &$form_state, $form_id) { $form['account']['#weight'] = 100; } Which is supposed to push the 'account' section of ...
0
votes
1answer
28 views

Using ajax in my entityform

I have a content type called Area and another content type called apartment that has a reference to area. I have an Investment form (using entityform module) in which users select which area; after ...
0
votes
2answers
38 views

how detect form is submitted? [closed]

I use Drupal 7 and the Webform module. How can I know if a form is submitted or not? I need this to show either error messages or success message after form submission in form page. I prefer not to ...
1
vote
0answers
18 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
15 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
1answer
42 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
14 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 ...