This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

How to submit a form with 4.7 form api

I want to develop a simple block module with a simple form. The form has 2 textfields and the values should be saved to a db table. The block developed with the 4.7 form api is shown correctly with my code, but I'm not able to submit the form. Here's my code

<?php

function quickmail_perm(){
return array ('can send quickmail');
}

function quickmail_block($op = "list", $delta = 0) {
if ($op == 'list') {
$block[0]['info'] = t('Quickmail Block');
return $block;
}
elseif ($op == 'view') {
$block['subject'] = 'Quickmail';
$block['content'] = quickmail_form();
return $block;
}
else {
quickmail_submit();
}
}

function quickmail_form($edit = null) {

$form['details']['firma'] = array(
'#type' => 'textfield',
'#title' => t('Firma'),
'#default_value' => $edit['firma'],
'#size' => 15,
'#maxlength' => 128,
'#description' => null,
'#attributes' => null,
'#required' => true,
);
$form['details']['telefon'] = array(
'#type' => 'textfield',
'#title' => t('Telefon Nr.'),
'#default_value' => $edit['telefon'],
'#size' => 15,
'#maxlength' => 128,
'#description' => t('Geben Sie hier die Telefon Nr. ein unter der Sie unseren Rückruf erwarten.'),
'#attributes' => null,
'#required' => true,
);

$form['details']['submit'] = array(
'#type' => 'submit',

Virus alert module?

Is there a module for the virus alert level or can someone point me in the right direction to making one.

Problem, upload.module v1.83 creates a duplicate when attaching file in 4.7b6

Greetings,

I'm using 4.7b6 and cvs upload.module v1.83. When I upload an attachment the upload graphic that shows it's uploading continues indefinitely even though my browser states the file is Done. So I ignore the fact that it looks like it's still uploading and click Submit. Then I notice that there are two versions of the file I just uploaded. Using inline.module also results in two of the file/images showing up in my story/page post even though I've only added one [inline:1] direction.

Forms API: HDI handle fields dynamically added from the client side?

I have a nicely working script that can be seen at work over in CVS to add more form fields as needed to my edit page.

I had much magic going on under 4.6, (functional demo of the relationship module but I'm having a blue hell of a time remaking that functionality under 4.7.

Missing argument 2 for filter_form_validate()

I am using v4.7B6 and filter.module filter.module,v 1.113 2006/03/14 15:15:46 unconed Exp $.

This error occurs:

Missing argument 2 for filter_form_validate() in /mnt/am2/08/231/00000012/htdocs/soccer-wikki.info/modules/filter.module in Zeile 833.

I already included the patch and the function now looks

function filter_form_validate($form_id, &$form) {
   foreach (element_children($form) as $key) {
     if ($form[$key]['#value'] == $form[$key]['#return_value']) {
       return;
    }
  }
  form_error($form, t('An illegal choice has been detected. Please contact the site administrator.'));
  watchdog('form', t('Illegal choice %choice in %name element.', array('%choice' => theme('placeholder', check_plain($v)), '%name' => theme('placeholder', empty($form['#title']) ? $form['#parents'][0] : $form['#title'])), WATCHDOG_ERROR));
}

I saw lots of posts somewhere similar to my problem, but neither fixed it or gave me an indication what to do.

By the way .. I am using PHP 5.

Suggestion: Datafeed module

I think many affiliate marketers may be very interested in a module that can manage and display product datafeeds given by merchants on a drupal site. What do you guys think?

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions