Tagged Questions

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

learn more… | top users | synonyms (1)

0
votes
0answers
17 views

ajax modified form drop down doesn't save

I have used form_alter to add a ajax callback to an element to my form. When the user chooses an option, it creates dropdown options for the other field. However, while this works fine for changing ...
0
votes
0answers
10 views

Help text blocks show up randomly in node add/edit form with Drupal Bootstrap theme

I come to you this morning because I can't get rid of this display bug. I set a Help text for all my content-type's fields to guide my users in the node add/edit forms. However, these text blocks ...
0
votes
1answer
22 views

Show table contents in custom Form

I have a table named "Table1" in my Drupal, where I added fields by getting the inputs via form. The form is created by custom module. My next requirement was to again create another form, but this ...
0
votes
0answers
8 views

Avoid using go_to() in the submit function but return to a fragment of the page [duplicate]

I have a e-commerce site whose landing page lists available products. Now you can mix and match any of them - Am using checkboxes to let the user interact with the products. At the end of the form I ...
1
vote
0answers
10 views

Drupal 7 - how to add custom field token to webform default value?

I want to add node-field data into the web from block via tokes as with Webform 7.x-4.1 this should work. But tokens from custom fields are not available in a webform(block) ? [node:title] and ...
1
vote
2answers
22 views

Change content of email verification email based on gender provided by user

In my website when a user submits the registration form and email verification is sent to them. Is there a way to change the content of the verification email that is sent after the user submits the ...
0
votes
1answer
36 views

How to theme form elements in a custom field widget?

I'm creating a custom telephone field and I'm a bit confused at how to go about theming the widget. I have four elements in my implementation of hook_field_widget_form()... A dropdown for the ...
0
votes
0answers
9 views

How to override form_error in webform_validate_unique function provided by webform.components.inc

I have a Webform module provided form that will be used by anonymous users. I need to avoid duplicate submissions from the same user, but can't rely on cookies or IP address (multiple users at same ...
0
votes
1answer
14 views

Add markup before form output for user-login

I've created a template override for the user login form (user-login.tpl.php) and want to put some content before the form's elements (e.g, header text and copy). Anything you add in ...
0
votes
3answers
38 views

How to create a multi step form that can be saved/edited by multiple users?

I need some tips on how to implement a form with these specifications: Multi steps. for example the user completes section 1 then clicks next to go to section 2 and so on (can be tabs or anything ...
0
votes
0answers
9 views

AJAX Form Not Inserting Default Values Based on Variables

I'm creating a content creation form for a custom node type that will be updated with AJAX. The basic idea is that this is for processing media mentions, and the AJAX will call a function that will ...
0
votes
1answer
19 views

Add Nested <ul> List into $form

I have something like this. How can I make $upload_items be a nested <ul> list under Upload examples Something like <ul> <li> Upload Ex </li> <ul> ...
0
votes
0answers
15 views

using views and unsaved fields

I have two numeric fields on a content type. I wanted to be able to show a mathematical calculation of these fields on the content add form in real time as they are being updated. If it was a node I ...
0
votes
0answers
10 views

Drupal form placeholder [duplicate]

I made a form using the custom module "homepage_userlogin". I want a placeholder in my form. The code of the custom module is: <?php function homepage_userlogin_form($form_state){ $form = ...
1
vote
0answers
18 views

Is it possible to let a user change value of a single field in their account profile without going to the user edit page?

On my site, users have several single-value boolean checkboxes as part of their profiles. In various places on the site, I want to let users toggle one of these fields on or off without going to the ...
0
votes
2answers
15 views

Printing a form inside a block

I have a specific block that has some form logic, intended for newly registered users. And I am a bit lost on what the logic would look like to render the contents for the form inside a ...
0
votes
0answers
11 views

How to change integer field suffix base on value of other field

I have a content type property which has price as integer field and contract type as radio with options "Rent and Sale". I would like to change the price suffix depending on contract type option ...
0
votes
0answers
13 views

Redirect to the form with field autopopulated with values retrieved from the node

I have a drupal custom module which creates a form in which a user can fill different fields and then, after submit, a custom node content is created and filled, where each content type field is ...
1
vote
1answer
15 views

How to put description on top of the input box, for a new field added to comment form?

I have added a new field to my comment form and this is how my comment form look liks: So you can see it does not look nice, I want to have the description on top of the input box, where I say: ...
0
votes
2answers
22 views

HTML Form that Passes Information to Hidden Fields Through URL

I am trying to build an html form that is stretched across several pages. My intention is to use the GET method to send all of the fields data in the query string (URL parameters) and then store this ...
0
votes
1answer
15 views

Is it necessary to embed captcha into the printmail form of print module?

I installed print module and it enables the users to send the node and its link to an email by redirecting them to a form. from security perspective is it safe to let them to do this with out captcha ...
0
votes
2answers
26 views

how to send variable to the javascript in Drupal

what is the easiest way to send a value from PHP to Javascript in drupal fom
0
votes
0answers
14 views

module_form_submit not working from template (.tpl.php) file

I have added a template file for one of my modules, I have also implemented the form api to get buttons inside the file. The buttons appears on the page but re-direct to the same page, as if the ...
0
votes
0answers
3 views

Panel is removing my form tag

I've created a Panel showing a form declared in a module within a block, but when I save it and view it, it removes the <form> tag and does nothing. Any help why this could be happening? My ...
0
votes
0answers
11 views

Temp images still aren't being saved in custom module form

I have what appears to be an expected issue with Drupal 7 in my custom module. My temp images are removed every few hours when the system_cron() function runs. I am, however, using a form submit ...
0
votes
1answer
19 views

How do you add information text to a Drupal 7 form?

I have this: $form['rate_the_room']['room_rating'] = array( '#type' => 'radios', '#title' => 'How would you rate the room you stayed in?', '#options' => array(1 => 1, 2 => 2, 3 ...
0
votes
2answers
32 views

Multi step form with click and state logging in Drupal 7?

I need to create two separate forms flows. Essentially the one case has 3 pages (intro, questions, thank you), while the other has 4 pages (intro, questions, questions, thank you). I want to be able ...
0
votes
0answers
22 views

#limit_validation_errors submit problem

I have a problem using #limit_validation_errors for a submit button on which I dont want all the validations to run. Here's my custom submit button : $form['actions']['draft'] = array( '#type' ...
0
votes
0answers
10 views

split result into two fields from autopopulated module in D7

I have a form with 2 fields I have created a module which pre-populates field1 based on what is keyed and what is found in the db. The SQL query is getting 2 columns from the db and I would like the ...
0
votes
0answers
12 views

Ajax form doesn't work when I moved '#ajax' block to submit button

I started to study the example from this page: https://www.drupal.org/node/752056 It works. But when I moved the '#ajax' block into $form['submit'], $form_state['values']['howmany_select'] is always ...
0
votes
1answer
34 views

Submit few forms in Drupal 7

I try to add Poll-voting to my website, on page I addet 5 votings forms, I try to make submission of all 5 forms by one click instead of 5 clicking. I wrote this script : <script ...
2
votes
1answer
32 views

Alter html output of a term reference form field

On my node edit form a term reference field is rendered with the following html output: <div class="form-item form-type-radio form-item-field-trainingstype-und"> <input type="radio" ...
0
votes
1answer
18 views

hook_form_alter Save $form['account']['field_first_name'] into $form['profile']['field_first_name']

Hi I'm trying to save a field into another field in the same form when the form is submitted. I've tried using hook_form_alter and checked for count($form_state['input']) > 0 to save ...
0
votes
0answers
31 views

How to use theme functions in .module files?

I am trying to override theme_radio and theme_radios directly in MY_MODULE.module file. For this purpose I declared these functions: 1) /** * Implements hook_theme(). */ function ...
0
votes
1answer
13 views

Form API Submit Button for Multiple Forms

I created a module with 3 forms on it. Is there a way to only have one submit button at the very bottom of the page that will store all three values?
0
votes
0answers
38 views

Ajax error when uploading image

I have a problem on my Drupal website since 2 days. When I try to add a new image (50 KB), the thumbnail is not displayed after transferring the image so I have to save the element and open it again ...
0
votes
0answers
10 views

when i onclick radio button then it's value should display in textfield [duplicate]

here i have two radio buttons radio button "One" and radio button "Two", when i click/check on radio button "One" then then it's value should display in textfield of "Display". ...
0
votes
1answer
49 views

when i onclick radio button then it's value should display in textfield

above is the sample screenshot of my form where i would like to do is: when i click/check on radio button "One" then then it's value should display in textfield of "Display". Code: function ...
0
votes
1answer
15 views

Append a Drupal form table

For the past few days I have been trying to update a rather simple table with ajax. The table cannot be rebuilt. This is of my own accord, if the table is rebuilt all of the colors data that was ...
0
votes
1answer
14 views

Set the value of a hidden field in form block

Using the code below in a block, I am displaying a form in a block on all pages for a content type called Goals. I want to use this block / form to update progress on the goal to a content type called ...
0
votes
0answers
21 views

drupal 7 on submission of form respective form should open

in my form i have to show two radio button and one submit button,please see below my front form is like this: candidate(radio) organization(radio) submit button. my requirement is that if user ...
0
votes
2answers
15 views

on submission of form respective form should open

in my form i have to show two radio button and one submit button, for example candidate(radio) organization(radio) submit button. my requirement is that if user click/check on candidate and ...
0
votes
0answers
13 views

on submission of form respective form should open [duplicate]

in my form i have to show two radio button and one submit button, for example candidate(radio) organization(radio) submit button. my requirement is that if user click/check on candidate and ...
0
votes
0answers
11 views

How to add token replacement for help text for a multi-value field

The entity reference form field help text does not do token replacement and I will have to call token_replace on it manually. I can do it in a form_alter by cycling through the fields. But ideally I ...
0
votes
2answers
48 views

Add cropping option to an image form

I've the next form. $form['imagen'] = array( '#title' => t('Image'), '#type' => 'managed_file', '#upload_validators' => array('file_validate_extensions' => ...
0
votes
0answers
20 views

Error uploading file. An unrecoverable error occurred

I've been troubleshooting a form in Drupal 7 that has two file upload fields. If you upload a file with one field, then the other, the second upload will usually give an error. This occurs regardless ...
0
votes
0answers
22 views

Drupal custom form with AJAX and javascript event

I have a custom form that is displayed in a custom block. That block is a popup div. When a user fills the form successfully it's displaying success message. I want to attach a jQuery that will ...
-1
votes
1answer
13 views

How to restrict access to page by URL depending on which page you came from

I have page which implements by hook_menu and i want to permit access for this page if user come from certain form but not from just url string. How can i solve it? Thanks.
0
votes
0answers
11 views

Changing label in custom search form

I have created a custom search form and am using it within a block. I have selected a content type under the Content Selector area called Basic Content. I want to change that label to read Foo but not ...
1
vote
2answers
31 views

Redirect to a specific page when user update their profile

Is there any way to redirect the user after save their profile information. I would like to redirect them to a specific page. To be clear, here is the Flow: User go in his profile He change his ...