Hi,

Not sure if what I expected is currently a feature but I thought a form would be cleared upon succesful submission but this doesn't happen in my case. (tested in various browsers)

Is there a way to achieve this functionality?!

Cheers

Comments

bartezz’s picture

Fixed with this code

Drupal.Ajax.plugins.customAjax = function(hook,args){
	if(hook === 'afterMessage') {
			args.local['form'].a_clearForm();
	}
};
Sjarsena’s picture

Where do I place this code?

bartezz’s picture

For instance in the .js file of your theme...
Could also make a custom module but that's a bit ovber the top...

Cheers

gebranbs’s picture

goto modules/ajax/ajax.js Drupal.Ajax.go funtion and add the below on success state
$(':input','#'+formObj.attr('id')).not(':button, :submit, :reset, :hidden').val('').removeAttr('checked').removeAttr('selected');

bartezz’s picture

Never hack core or contributed modules! All changes are lost in updates. Add to custom theme .js file or write a custom module to add my code.

Cheers

brendoncrawford’s picture

Category: support » bug
Status: Active » Needs work