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

learn more… | top users | synonyms (1)

0
votes
0answers
4 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
16 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
13 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
15 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
10 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
8 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
11 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
15 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
25 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
12 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
28 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
18 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
11 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
30 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
12 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
33 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
9 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
43 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
12 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
19 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
14 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
10 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
16 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
21 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
10 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 ...
0
votes
0answers
15 views

Alter fields added with field_attach_form()

I'm adding fields from a content type to a custom edit form using field_attach_form() and passing the field name to the $options parameter to get the fields I want. How do I alter the parameters of ...
1
vote
1answer
24 views

How to know the “name” of an input field of a commerce checkout form?

I need to find the name of an input field of a commerce checkout form to use in: form_set_error('NAME-HERE', t('Field cannot be left blank')); The html of the field is: <div ...
0
votes
1answer
18 views

Removing file from form breaks site

I created a module that hooks into the admin menu and allows you to upload a specific file for the site to use. It allows you to upload a file, and change a file, but as soon as you remove a file and ...
0
votes
0answers
14 views

custom entity admin page integrity constraints violation of managed_file in 'remove' process

I am developing a custom entity administrative page. The custom entity makes use of managed files. This is by storing a foreign key of file_id that references the file id in "file_managed" table. ...
0
votes
1answer
12 views

using hook_form_alter on a same form from 2 different modules

How will a predefined form behave if we have two different forms that implement hook_form_alter? I would explain my question by an example, because currently I got a crash on it: I have a predefined ...
1
vote
2answers
35 views

Update Two select box when change another select box

I have drupal form with three select box i want to change select box 2nd and 3rd after change value of 1st select box. ex: i have Three select box 1) Cruise line 2) Destination 3) Ship Id When ...
0
votes
2answers
26 views

How do I put registration form in panel in Drupal 7

I would like to know how to put a registration form or any other form to make a new content type in panels. I know the first thing to do is to put the registration form in a block. How can I do that?
0
votes
0answers
28 views

Adding form elements with jquery to a drupal form

I have a recipe form under node. Up until now, I had a button that would add another ingredient textfield by updating that section of the form with an ajax call. I can no longer do this. Now I have ...
0
votes
1answer
32 views

Different user form for registration and edit

I'm trying to make different forms layout for user registration and user edit account: - User Registration: Display it paginated, like a wizard. - User edit: Display it in only one page. I can use ...
1
vote
1answer
110 views

What properties does a custom cck_phone form field need to work?

I am struggling to get a working custom implementation of a cck_phone field from the cck_phone module. I have included my partially working code at the bottom. What seems to be not working is that ...