Needs work
Project:
Ajax
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Aug 2010 at 22:53 UTC
Updated:
21 Jan 2012 at 08:45 UTC
so if i disable the redirect on a form the following is called and it resets the values in the form fields, although it submits the form correctly. not sure i understand why its doing this.
args.local.form[0].reset();
Comments
Comment #1
mustanggb commentedI am seeing this also
With redirect disabled forms are reset to their previous unedited value
And dropdowns get reset to the first entry, even if it is not the old or new value
Comment #2
mustanggb commentedComment #3
theshanergy commentedIs there any word on this? I'm experiencing the same issue with 6.x-1.14.
Comment #4
hongpong commentedAre there any other tickets on this? Definitely an issue.
Comment #5
hongpong commentedby disabling the reset statement, the form did behave as expected with its values. Other issues with tokens cause other AJAX form save issues, however disabling the line does help with the browser's local form values.
Drupal.Ajax.plugins.disable_redirect = function(hook, args) {
if (hook === 'redirect') {
if (args.options.disable_redirect === true) {
//args.local.form[0].reset();
//IE
$('.form-item select', args.local.form[0]).attr('selectedIndex', 0);
if (args.options.remove_form === true) {
args.local.form.remove();
}
else {
$('.form-item :input', args.local.form[0])[0].focus();
}
return false;
}
}
}
Comment #6
brendoncrawford commented