Closed (fixed)
Project:
Webform
Version:
6.x-2.3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Dec 2008 at 10:29 UTC
Updated:
1 Apr 2009 at 07:35 UTC
email field with "default value" "Disabled" (uneditable) and "Manditory" set fails to submit and clears that field
I want the user to SEE that their default email address is there, but I don't want them to change it. I could unset mandatory to allow it to pass, but the flag combination should still be possible, or it should be officially disabled, IMO.
Comments
Comment #1
quicksketchThanks, this also applied to textfields and textareas also. In Drupal 6 the "disabled" property actually destroys the submitted data (as if the field were empty). This follows suit with Firefox, that implement the standard that disabled fields actually shouldn't even be set in $_POST. So disable fields are pretty much totally broken.
I've committed the following changes to both Drupal 5 and 6 versions that switches the "disabled" property to "readonly", which pretty much accomplishes the same goal in that the user can't change the value, but they can still highlight/interact with the element. It also gets submitted properly.
Commit: http://drupal.org/cvs?commit=163961
Comment #3
johnhanley commentedThis bug report solved my dilemma (albeit unrelated to Webform) where the "disabled" attribute was clearing the field selection and causing the validation to fail.
I ended up using the "readonly" attribute, which accomplishes the same thing and satisfies validation because the field value is preserved upon submission.
Example: