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

D6: drupal_render in form causes various problems (default value, ID, date_select)

I have a problem with drupal_render (assuming that drupal_render is the right way for me to get what I want - feel free to correct me =). I am building a form. Since the FAPI does not provide a "table"-field, I want to make one myself. My approach:…
Clemens
  • 3
  • 3
0
votes
2 answers

How to get form submitted values in page_preprocess function in drupal 7

I have some output data from databse on my page (few queries to db in mytheme_page_preprocess function) and i want to do search form (text field and submit button). So, how can i get form submitted values in preprocess function ? Something like…
inJakuzi
  • 151
  • 1
  • 12
0
votes
1 answer

drupal 7 form theme function not being called

I'm trying to register a theme function for a simple form in a custom module, but the theme function is not being called. I just get the basic form. Here's my hook_theme(): function kss_membership_theme($existing, $type, $theme, $path){ $items…
user497587
  • 45
  • 9
0
votes
2 answers

Drupal - Validate form before submit / Encrypt password before send it

I would like to modify (encrypt) the login password in Drupal, before it sends it decrypted to server. I didn't find any module to do that (validation before submission), and I couldn't find a way of validate the fields before they are sent to…
user1695700
  • 71
  • 2
  • 12
0
votes
4 answers

Drupal 6 passing variables from Forms to Content, how to?

I created a BLOCK (left) with this simple form. Now I want to PROCESS and DISPLAY results on PAGE (center) How can I do it ? inputs: name = James surname = Bond output I want :
Welcome, James Bond
here is a BLOCK which…
David King
  • 2,010
  • 5
  • 19
  • 23
0
votes
1 answer

submit button appears only after selection from the dropdown list doesn't work - drupal 7

Submit button appears after selecting from the select list drop down , Can anyone help me understand why it is not working? $form['user_fields']['optinal_packages'] = array( '#type' => 'select', '#title' => t('Optional Packages'), …
dana ohayon
  • 61
  • 1
  • 1
  • 3
0
votes
2 answers

Select list in Drupal 7 custom form element

I have created several custom elements in a module, which work great for grouping several controls in a single form field. However, I now need to add one that contains a drop-down list. The idea is to have a drop-down list of country codes, and a…
James Shields
  • 309
  • 4
  • 12
0
votes
1 answer

drupal position of the form-required indicator

In drual 7 my forms are outputting like this The problem being the form-required indicator goes at the front. I cannot find the hook. I…
LeBlaireau
  • 17,133
  • 33
  • 112
  • 192
0
votes
0 answers

Drupal Form Radio Button No Index on 1st Button

I have a form in Drupal 7 that generates Radio Buttons from a custom function. On submit I take the index value of the selected button and process it thru another custom function. My problem is that if the first radio button is chosen the index…
Ken J
  • 4,312
  • 12
  • 50
  • 86
0
votes
1 answer

Extra text input in image widget -- Drupal 7

I have a content type that contains an image field and uses image_image widget. When editing the node I'd like to add an extra text input for each image. This text is not part of the node, I'd use it to generate a translation. I know how to do tweak…
ozs
  • 5
  • 3
0
votes
1 answer

Drupal Form-API: #field_prefix doesn't work on textfield

I'm trying to implement #field_prefix on a text field so I can add some extra UI to my form. I have a module where I'm doing other overrides like this, with a function that basically looks like this: function modulename_form_alter(&$form,…
ack
  • 14,285
  • 22
  • 55
  • 73
0
votes
1 answer

Drupal Form API Facebook Login

I have Facebook for Drupal installed on my Drupal instance. My application and everything is working fine. I want to make it so one of my custom content types requires Facebook login to submit. Can I do this using the hook_form_alter()? This will be…
hanleyhansen
  • 6,304
  • 8
  • 37
  • 73
0
votes
1 answer

User registration form validation in drupal 7

Drupal 7 comes with the built-in user registration form (user/register). I use this form for new users to register. Which is quite obvious. Now the problem is, and I find it hard to believe that it isn't there, I need some validating. When a new…
Tim Reynaert
  • 145
  • 5
  • 19
0
votes
2 answers

The page isn't redirecting properly when i try to call drupal_get_form

Why Drupal 7 cannot redirect properly (I've logged in)? When I'm trying to call drupal_get_form('user_login') from my module in hook_preprocess_page(), the browser throw that message. Thank you!
0
votes
2 answers

Stop a custom submit button from firing the form validation on a CCK form

I've added a submit button inside a fieldgroup on a CCK form using hook_form_alter as follows: function mymodule_form_alter(&$form, $form_state, $form_id) { if ($form_id == 'object_node_form') { $form['group_wikipedia']['search'] = array( …
hitfactory
  • 2,896
  • 5
  • 24
  • 22
1 2 3
13
14