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

Form is only submitted once

Hi,

I have a problem with creating forms. My code (just relevant parts, as I think):

function user_gallery_menu($may_cache) {
	$items[] = array(
			'path' 		=> 	'usergallery/admin',
			'title'		=>	t('adminarea images'),
			'callback' 	=> 	'_user_gallery_admin',
			'access' 	=> 	true,
			'type' 		=> 	MENU_NORMAL_ITEM
	);	
	return $items;
}

function _user_gallery_admin() {
        $themeingstring=theme(...);
	return drupal_get_form('user_gallery_frm').$themingstring;
}

function user_gallery_frm() {
	$form=array();
	$form['#attributes'] = array("enctype" => "multipart/form-data");
	$form['image'] = array('#type' => 'file', '#title' => t('Image'), '#weight' => -3);
	$form['submit']=array('#type'=> 'submit', '#value'=>'Hochladen');
	return $form;
}

function user_gallery_frm_validate($form_id, $form_values) {
//validation
}

function user_gallery_frm_submit($form_id, $form_values) {
    drupal_set_message('submitted');
   cache_clear_all();
}

After submitting the form the first time, the message "submitted" appears as I wanted. After submitting the same form again (where I have been redirected to), no message appears. And it seems, neither the validation nor the submit-function are called. So I entertained suspicion, that the page was cached. But when I turned off caching, it is still not submiting.

Drupal Reinstall Script

I've written a reinstall script for Drupal. It is not a module and should be placed on the top directory. THIS SHOULD ONLY BE USED FOR DEVELOPMENT PURPOSES. It clears your DB and then runs the install script.

Sending email

Hi,

I have 2 questions about using email though an Drupal site installed and working.
1: how can i simply send an email to an external adresse (i mean not to an authenticated users)? Is there any module that could give me a simple interface for sending mail using drupal?
2: Is there any functionable webmail module working with pop/imap/smtp protocol without needing to integrate 3rd part program like roundcubemail?

Thanks for your answer

date value of text field (set by using javascript popup calendar) does not appear when editing node

Hi,

Please note ...I am learning to program in Drupal/PHP....and have tried getting help from posts in the forum....not much luck...

I am exploring the use of the javascript popup calendar (jscalendar) in a custom node module. I am creating a very basic module to test this. Also, I've used the readme file provided by the author of jscalendar for help.

the main functions of the module is listed below.

here's a brief description

I am able to use the pop calendar attached to the field, fromdate to select a date. It is entered in the table, exam as : 2007-07-17 13:28:06.

fieldtype of fromdate in table exam is varchar2(20).

When I view the node, I see the value of fromdate.

When I go to edit the node, the text field fromdate in the form is blank. If I use this popup calendar in a CCK nodetype, the value does appear in the textfield when the node is viewed in edit mode.

I would like the value to appear in the textfield ,fromdate when the node (that is, from my custom module)is viewed in edit mode.

I suspect it is my exam_load that may be the problem....or do I have to use exam_prepare function to set the date display format. I've tried this..not getting it to work...I'm not understanding this properly.

Any ideas on what I am doing incorrectly or not doing at all....or need to do ?

date value of text field (set by using javascript popup calendar) does not appear when editing node

Hi,

Please note ...I am learning to program in Drupal/PHP....and have tried getting help from posts in the forum....not much luck...

I am exploring the use of the javascript popup calendar (jscalendar) in a custom node module. I am creating a very basic module to test this. Also, I've used the readme file provided by the author of jscalendar for help.

the main functions of the module is listed below.

here's a brief description

I am able to use the pop calendar attached to the field, fromdate to select a date. It is entered in the table, exam as : 2007-07-17 13:28:06.

fieldtype of fromdate in table exam is varchar2(20).

When I view the node, I see the value of fromdate.

When I go to edit the node, the text field fromdate in the form is blank. If I use this popup calendar in a CCK nodetype, the value does appear in the textfield when the node is viewed in edit mode.

I would like the value to appear in the textfield ,fromdate when the node (that is, from my custom module)is viewed in edit mode.

I suspect it is my exam_load that may be the problem....or do I have to use exam_prepare function to set the date display format. I've tried this..not getting it to work...I'm not understanding this properly.

Any ideas on what I am doing incorrectly or not doing at all....or need to do ?

To patch or not to patch

Hello Everyone,

I just started developing with Drupal last week and I'm on a project where I need to set up heirarchical taxonomy terms in this level (root to base) Country, State/Providince, City (if that tree doesn't exist) whenever a user adds a new special node that we call practitioners to the system.

Pages

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