I am having trouble clearing the form input upon failed validation of the form.
For example the form validation function would throw an error if there is a there is any radio button element in the form, of which there is two groups, left unchecked. …
I am trying to build a custom field in drupal 7. evrything work just fine, except from the wysiwyg field.
I am using the next code to build an WYSIWYG element:
$element['my_body'] = array(
'#title' => t('Editor'),
'#type' => 'text_format',
…
I have a form with a drop-down 'select' element that the user will sometimes need to add to. So, I added a link to open a Modal Frame form, created the Modal Frame form, and made its _submit() function add the new data to the table that holds…
I want to create modules for my content types. Looking over the drupal field api as well as some examples of creating content types programmatically, i have a basic module. But theres a few things I can't seem to get working.
On text_with_summary,…
update
I have made a Drupal Form with the Form API. I used a the element select, my question how can I get the value that the user chose?
For the example: the following code. How can I know what the user chose for 'Titles plus teaser' (teaser).…
The situation
I am implementing a few forms using the Drupal Form API. As a result of user selection i need to display a visualization (area chart, time line, etc) where i have to load the google's JS libraries and send data to display the visual in…
I'm looking for a good, standards friendly way to alter the default comments form, such that there is a disclaimer immediately below the "Reply" header. I only want this disclaimer to appear above the comments form itself, not meerly when viewing…
I inherited a project that seems to have a ton of custom modules. A lot of the modules have includes folders with include files that have regular HTML forms. I know that Drupal preaches using FAPI. My question is that in your experience are there…
In my hook form alter, this is the date of birth array:
[Birthdate] => Array(
[#type] => fieldset
[#title] => Birthdate
[#weight] => 1
[profile_birthdate] => Array(
[#type] => date
[#title] => Birthdate
[#default_value] =>
…
I trying to get the twitter_admin_form and twitter_user_settings form in a div.
/**
* Get twitter form for user
* @param $account
* @type user object
*/
function getTwitterForm($account){
//module_load_include('inc', 'twitter');
…
I have a situation that if my form doesn't validate I need it to remove all but the first argument from the url. The reason for this is because the results of my form are displayed below the form in the content area. If the form doesn't validate I…
Correct me if I'm wrong, after reading drupal fapi related articles, I got the impression that fapi generates 'id' attributes by itself. It allows developers to assign 'name' attribute only. If that's the case, is there a way I can set desire 'id'…
I am trying to add the new Facebook log in button to my registration page on my Drupal site.
I know the following code is wrong, but I don't know the right syntax to implement it:
function facebook_user($op, &$edit, &$user, $category = NULL) {
…
How would you go about constructing a step by step form that uses AJAX through Drupal to pull the next form step?
For example,
Step 1:
I like Baseball
I don't like Baseball.
When that person clicks on either Like or Don't Like, I want to use…