Issues with disabling a form field
I'm using the method given at http://drupal.org/node/357328#comment-3021230 to disable a submit button in a form (after trying to simply set #disabled in hook_form_alter). I have the module set with a weight of 10, the code works as it should in terms of setting the attribute for the field (below), but the field is not disabled. I note that the attribute is being set to 'disabled' rather than TRUE in this and another almost identical example. I tried it with TRUE just in case, to no avail. checkout(/Array,*21 elements*/) * #type(/String,*6 characters*/)*submit* * #value(/String,*8 characters*/)*Checkout* * #submit(/Array,*1 element*/) * #post(/Array,*0 elements*/) * #programmed(/Boolean/)*FALSE* * #tree(/Boolean/)*FALSE* * #parents(/Array,*1 element*/) * #array_parents(/Array,*1 element*/) * #weight(/Float/)*0.003* * #processed(/Boolean/)*TRUE* * #description(/NULL/) * #attributes(/Array,*1 element*/) o disabled(/String,*8 characters*/)*disabled* * #required(/Boolean/)*FALSE* * #input(/Boolean/)*TRUE* * #name(/String,*2 characters*/)*op* * #button_type(/String,*6 characters*/)*submit* * #executes_submit_callback(/Boolean/)*TRUE* * #process(/Array,*1 element*/) * #id(/String,*13 characters*/)*edit-checkout* * #defaults_loaded(/Boolean/)*TRUE* * #sorted(/Boolean/)*TRUE* -- Ayen Designs 388 Bullsboro Drive #105 · Newnan, Georgia 30263 404-271-9734 Web:ayendesigns.com <http://ayendesigns.com> Blog: theAccidentalCoder.com <http://theaccidentalcoder.com> Drupal: j. ayen green <http://drupal.org/user/367108> IRQ: j_ayen_green IM (Yahoo) baalwww (MSN) baalwww@yahoo.com Skype: ayendesigns Ayen Designs is a tradename of the computer services division of
I think you need '#disabled' => TRUE
I did too, but that didn't work, which is when I read that that didn't work with cck fields (I'm using this on the UC cart form). As it turns out, the solution I referred to DOES work... but what I just discovered is that even though clicking does nothing, there is no visual cue that the submit button is disabled, because hovering over the button still changes the cursor to a hand. On 01/21/2011 02:54 PM, Earl Miles wrote:
I think you need '#disabled' => TRUE
Hello Jeff, On Fri, 2011-01-21 at 10:47 -0500, jeff@ayendesigns.com wrote:
I'm using the method given at http://drupal.org/node/357328#comment-3021230 to disable a submit button in a form (after trying to simply set #disabled in hook_form_alter). I have the module set with a weight of 10, the code works as it should in terms of setting the attribute for the field (below), but the field is not disabled.
When working on the Delegate Menu Administration module I noticed that changes to the delegate_menu_admin_menu_alter() function would only show up after running update.php. Perhaps you are having the same problem? Regards, Leonard. -- mount -t life -o ro /dev/dna /genetic/research -- mount -t life -o ro /dev/dna /genetic/research
participants (3)
-
Earl Miles -
jeff@ayendesigns.com -
Leonard den Ottolander.nl