agaskar.com

Sep 17 2007

The Sensitive Programmer Part 2: #type=>’Submit’ causes mass confusion.

I don’t know why I have so much trouble lower-casing the word submit, but it will *really* bite you in the ass if you try to use it as a #type in a form statement.

Why? Well, $form[‘test’]=array(‘#type’=>’Submit’,’#value’=>’Test’); will HAPPILY render a submit button for you — it just won’t submit your form via the Drupal API (for that, you need at LEAST one properly rendered submit element in your form). this is all kinds of confusing if you’re cursed with a happy shift-finger like me.

Comments (View)
Page 1 of 1
blog comments powered by Disqus