Questions tagged [drupal-fapi]

The Drupal form API is a very strong, robust, easy and scalable API for creating forms in Drupal.

The Drupal form API is a very strong, robust, easy and scalable API for creating forms in Drupal.

Documentation about the form API can be found on:

Related documentation

196 questions
0
votes
1 answer

Drupal Webform Validation (webform_form_alter)

I'm doing some webform validation using webform_form_alter. I'm using webform_form_alter because I switch certain content on a "select" field. In my webform-form-317.tpl.php I defined new fieldsets I set my fields into this new fieldset and unset…
0
votes
2 answers

how can one override default registration email in a hook form alter registration?

The main site sends a registration email and I do not want that email to be sent to this new registration as it should have its own custom email. I am having a hard time with this because every time a user registers either on main registration or…
Strong Like Bull
  • 11,155
  • 36
  • 98
  • 169
0
votes
1 answer

How to create an image button that behaves like a button in drupal 7?

How I want it to work: I have list of buttons(type button) that trigger an Ajax call that add the that item to a list. This works as exactly as I want it except for the button looks ugly . The problem: When I try to replace the "button" with an…
mr_87
  • 13
  • 3
0
votes
2 answers

Does variable_get in Drupal have major issues with memcache?

On a few modules there is a variable_get that is pulling either the correct setting (toboggan/denied) or (node/200) even though the {variable} table is set to toboggan/denied? where is the node/200 coming from and why the randomness in values? Is…
Strong Like Bull
  • 11,155
  • 36
  • 98
  • 169
0
votes
1 answer

Using reCaptcha, Lightbox, and Drupal's Form API together

I've been wading through the issues of putting a Drupal form in a Lightbox2 lightbox. Perhaps wrongly, I've resorted to doing all the validation in javascript before submitting the form (I couldn't make the normal validation return the form within…
lazysoundsystem
  • 2,039
  • 23
  • 23
0
votes
1 answer

How do I hide a CCK Nodereference input widget in #after_build?

I like simplifying the node form. One of my tricks in the past has been to conditionally hide CCK elements on new node creation when I want to enforce some kind of default. One of my favorite tricks is to whisk away things put in place by the…
Grayside
  • 4,144
  • 21
  • 25
0
votes
1 answer

Drupal FAPI: How do I change a value in the validation function?

In the following code, I am trying to update the underlying form to a new value, but the value does not seem to update properly. function msul_tgif_xml_basic_search_form_validate($form, &$form_state) { //$Offset is computed properly as verified…
0
votes
1 answer

In Drupal 7, how do I show a new form that can edit data selected from a different form?

I have a tableselect form that lists several items. When a user selects one or more items, and clicks the edit button, I want a new form to show up that lets them edit the items. I have the new form structure being generated, but I can't get it to…
David R.
  • 518
  • 2
  • 9
  • 20
0
votes
1 answer

How to reset radio buttons selections on postback?

This is a Drupal Forms question. I am working on a UI that dynamically creates rows of 3 radio buttons based on a selected date. The problem I am having is that if I make some selections of the radio buttons and choose another date to get another…
PPC-Coder
  • 3,522
  • 2
  • 21
  • 30
0
votes
1 answer

Pass form data from block to a page view in Drupal

I am using the location module and views module for a postcode search, which works fine in a page display using views. However I want the user to be able to enter their postcode into a block on the homepage and clicking submit my module sends them…
0
votes
1 answer

Drupal 7 contact us form custom module

I want to write custom module for contact us form, I can not understand how to get started, i made two files(form_module.info and form_module.module) in module>form_module then added core = "7.x" description = "An example module used to…
nomeer
  • 205
  • 3
  • 13
0
votes
1 answer

How to dynamically remove field in Drupal 7 custom form using AJAX

Based on the "Add-more button (with graceful degradation)" example available in Drupal examples module I have created a form that can add fields dynamically using AJAX, and now i want to add a separate Remove button to each of those fields so that i…
PIKP
  • 753
  • 2
  • 15
  • 24
0
votes
0 answers

In Drupal after selecting a value in an autocomplet, I need to load field values from a database record

I am using Drupal 7's Form API to develop a prototype for an old system. I've managed to get the dropdown select boxes to load dynamically and dependently from the database. I have also managed to connect an autocomplete to the same database. …
0
votes
1 answer

How to make drupal known submitting custom content

I know this is not a drupal forum but, as I’m not getting any response there, I decided to give it a shot here. I’m creating a web site that accepts custom content from users. So, for that matter, this site has a form and a custom module. Instead…
Andrew
  • 1,035
  • 7
  • 22
  • 40
0
votes
3 answers

Theming Drupal Add Block form via forms API

Can anyone advise me on customising the Add Block form? (/admin/build/block/add) I want to hide the "User specific visibility settings" and "Role specific visibility settings" from users. This is what i've got so far, but obviously it's not right…
MrFidge
  • 2,107
  • 11
  • 40
  • 63