[development] Stupid forms/node API question

Syscrusher scott at 4th.com
Sun Dec 11 14:20:05 UTC 2005


On Saturday 10 December 2005 18:24, Karoly Negyesi wrote:
> There are at least two solutions:
> 
> a) You change $_POST
> b) You add a #value to the form element in this case. Have you read the  
> documentation that you should never use #value? This is the exception.  
> However, be extremely cautious what you set here, it'll be sent back to  
> the user.

BINGO! I changed #default_value to #value, and it works like a charm. I was
so happy I didn't even care that a seven-hour debugging session was cured by
a one-line code change.

I have another module that needs to sort an array of values, and possibly even
delete one or more of them entirely, rather than just changing one string.
I think I'll *have* to resort to changing $_POST. But that's okay, now that I
know it's a viable option.

Thanks kindly for the response. As soon as I have my code working, I'll submit
a documentation note (probably review it with you, Karoly, for technical
accuracy first, if you don't mind).

Scott
Doing the happy dance since his module's working now!

-- 
-------------------------------------------------------------------------------
Scott Courtney     Drupal user name: "syscrusher"   http://drupal.org/user/9184
scott at 4th dot com       Drupal projects: http://drupal.org/project/user/9184
Sandbox:  http://cvs.drupal.org/viewcvs/drupal/contributions/sandbox/syscrusher


More information about the development mailing list