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
1
vote
2 answers

Disable Arrows on input type="number" without javascript

fields have show up/down arrows (increment/decrement), how do I remove these (in Drupal 8) without using javascript? A client asked to remove the up/down arrows to prevent accidental changing of values. I've tried adding a…
1
vote
1 answer

How would you approach creating a "Mad Libs" style form in Drupal?

I'm intrigued by the idea in this article: "Mad Libs" Style Form Increases Conversion 25-40%. I'd like to test such a form in place of the registration form on a couple of Drupal sites; however, I'm not sure how to approach such an unorthodox form…
Matt V.
  • 9,703
  • 10
  • 35
  • 56
1
vote
3 answers

Drupal form being rendered before submit action

I have a Drupal module page where I am populating a form with a drop-down that contains a list of available parts of a set of files that the user can upload. Once the user uploads a file of a certain type, it removes that option from the list, and…
alxp
  • 6,153
  • 1
  • 22
  • 19
1
vote
3 answers

Drupal 6 File Handling

I am handling file upload field in a form using Drupal 6 form APIs. The file field is marked as required. I am doing all the right steps in order to save and rename files in proper locations. upload form $form = array(); .... $form['image'] =…
Shoaib Nawaz
  • 2,302
  • 4
  • 29
  • 38
1
vote
3 answers

Drupal: how to show a form (select) acting as filter options, then show a table of stuff from the database?

I want a simple filter form, and a table below it. When the user changes the option on the select form, the table automaticaly changes. I think thats done with ahah. I want this (some things can change, like the fieldset containing the table, and…
hfingler
  • 1,931
  • 4
  • 29
  • 36
1
vote
4 answers

Drupal form validation functions

Is there anyway say Drupal to validate form elements like email fields, passwords, numeric fields validate automatically lets say bind a system validator $form['email] = array( '#title' => t('Email'), '#type' => 'textfield', '#validate_as'…
sultan
  • 5,978
  • 14
  • 59
  • 103
1
vote
1 answer

Drupal form submission to a 3rd party website

I'm building a form in Drupal that needs to submit to a 3rd party website. Within the form API it seems like this is not really possible as you register form submission handlers to do all of the processing. I need to have the form method to to POST…
bkildow
  • 5,143
  • 4
  • 29
  • 37
1
vote
3 answers

Drupal 6 getting the node title from a submitted form

I am using form_alter to edit the submit function when editing content. In my custom function I wish to edit a custom message to the screen with the title name. I thought a way I could do this is something as follows function…
Linda
  • 2,227
  • 5
  • 30
  • 40
1
vote
1 answer

Drupal 6 editing the submit function on a content type

I have a content type and I wish to edit the submit function. I thought the way you would do this would be as follows: function moduleName_contentType_node_form_submit($form, &$form_state){ drupal_set_message(t('Test')); } I cleared the cached…
Linda
  • 2,227
  • 5
  • 30
  • 40
1
vote
1 answer

Drupal 6 Form Api adding an item to an existing form

I want to add a new item into an existing form. I have the ID of the form and I know I need to use hook form_alter but not sure how to add it. function modulename_form_alter(&$form, $form_state, $form_id) { switch ($form_id) { case 'form…
Linda
  • 2,227
  • 5
  • 30
  • 40
1
vote
2 answers

Drupal cck checkbox with global setting

I am creating a "sticky" checkbox for my content type "news". this means that one news node is sticky, and is used in a banner like box. This is marked by a checkbox int the cck create content form. The checkbox is handled by the node_api, so I…
Nealv
  • 6,856
  • 8
  • 58
  • 89
1
vote
1 answer

Drupal jquery submit form without submit button

I have a drupal form which i post using jquery when you select an option from a selectlist (a sort of quicksearch selectlist). The porblem is that when i submit by clicking the button, it works. When I use jquery, and the button is in the form…
Nealv
  • 6,856
  • 8
  • 58
  • 89
1
vote
1 answer

How to uninstall a module that overrides the core user module?

One of my developers wanted to override some functionality of the core user module. He made a copy of the core user module and placed it in the sites/all/modules folder. Something in the functionality screwed up and now I am not sure how to…
Strong Like Bull
  • 11,155
  • 36
  • 98
  • 169
1
vote
3 answers

Need to add some custom HTML before a form gets returned..How?

I need to display some custom HTML/Processing code before a Drupal form can be shown. How do I return both the custom HTML and the form? The code I have is: function myfunction() { global $base_path, $base_url; $output = ""; // Clear the…
Strong Like Bull
  • 11,155
  • 36
  • 98
  • 169
1
vote
1 answer

Why is my form not updating as it should?

The submit handler gets the same form values no matter what I put in the form. Why??????? function edit_schoolinfo_form() { global $user; $result = db_query("SELECT * FROM {db} where userid=%d", $user->uid); $sas_school_info =…
Strong Like Bull
  • 11,155
  • 36
  • 98
  • 169