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: Form generation (Drupal 7) Form API reference (Drupal 7) Form API documentation section (Drupal 6) The documentation page for drupal_build_form() ...
1
vote
1answer
12 views
how to add #states property to a field element in drupal 7?
I wanted to add #states property to a select list field in cck input form created by content type. I ve tried the following code but the states property is not set to the field. Can anyone suggest on ...
-3
votes
1answer
37 views
HTML ul and li in Drupal 7 [closed]
How to write HTMl ul and li without using form API in a module. Can we use general HTML in drupal
0
votes
0answers
19 views
AJAX submit ignored if comments form is loaded with AJAX
In D7, I have a custom module enabling AJAX form submission on comments forms. That is working great.
I also have comments being loaded in the commentsblock module using block_refresh with the below ...
0
votes
1answer
27 views
Form API - match field with error
I have a weird question. Let's say we have this form:
$form['field1'] = array(
'#type' => 'textfield',
'#title' => 'First field'
);
$form['container'] = array(
'#type' => 'container'
...
1
vote
1answer
15 views
Set input value in custom search module
I'm using custom search module in my site. What I want to do is set a value for the input (text box) in the username and password field.
How can I do that?
1
vote
1answer
31 views
Add JavaScript 'effects' to be used with AJAX form submissions
Consider the following code:
$form['actions']['submit']['#ajax'] = array(
'wrapper' => 'apple-node-form',
'callback' => 'node_add_callback',
'method' ...
2
votes
1answer
23 views
Trying to submit a node add form via AJAX but failing
I'm simply trying to submit a node add form via AJAX:
function input_form_alter(&$form, &$form_state, $form_id) {
switch ($form_id) {
case 'page_node_form':
...
-1
votes
0answers
34 views
How to display the db select data result set in table format at the bottom of the form in drupal 7?
Using FORM API, I created a textbox and am passing the values to the db_query.
The result of the db_query renders as intended in a table, but above the form, instead of after the form, as I would ...
0
votes
1answer
24 views
How to get value from field widget during AJAX callback loop?
A select element on my form gets processed with an AJAX callback. There is a Multiselect widget on the form, and I want to see the new value of the field as if the form had been submitted. But, the ...
0
votes
0answers
28 views
How would I change the label of a field in hook_form_FORM_ID_alter()?
For a Drupal 7 site, I'm trying to alter a form into multi-step and want to change the label of a field based on some answer from the first step, which is the reason for my question.
I tried ...
0
votes
0answers
22 views
Ajax is not working for Drupal comments form
I have created two content types slideshow and slides. I am assigning slides to slideshow with the help of node references. One slideshow can contain n number of slides. When I am showing slideshow I ...
0
votes
0answers
23 views
Parsing XML files to populate form fields
I need conceptual clarification. I have fields of a form that I want to populate by letting a user use an XML file so my custom form module can parse and assign XML to form fields. I do not need to ...
2
votes
1answer
13 views
How to weight a block above a custom form
I'm creating a page with a form with the hook_menu:
function my_module_menu() {
$items['rsvp'] = array(
'title' => 'My Page',
'page callback' => 'drupal_get_form',
'page ...
0
votes
0answers
23 views
Missing $form_state[…][#value] in AJAX callback from <select> inside jquery UI $.dialog()
jqueryUI $.dialog() control is included on the form like this:
'#attached' => array(
'library' => array(
array('system', 'ui.dialog'),
),
)
I have an AJAX ...
0
votes
1answer
36 views
form with taxonomy autocomplete widget throws error upon submit: Invalid argument supplied for foreach()
I have a custom form with this field in it:
$form['first']['field_city'] = array(
'#title' => t('Woonplaats'),
'#type' => 'textfield',
'#size' => 25,
'#autocomplete_path' ...