[development] Node limbo

Scott Reynen scott at makedatamakesense.com
Sun Apr 24 23:28:04 UTC 2011


On 4/24/11 4:47 PM, jeff at ayendesigns.com wrote:

> I have a field myfield that I send to the client as a hidden field with
> value 0. I change the value, via javascript, on the client.
>
> When I dsm $form in form_submit (I didn't try form_state yet), I see
> form->myfield->value as 0, but form->myfield->#post->myfield has the
> correct value.

Are you perhaps setting your value on the hidden field with #value 
rather than #default_value? There's a note about that here:

http://api.drupal.org/api/drupal/developer--topics--forms_api_reference.html/6#hidden

"Note that if you plan to use JavaScript to change your hidden element's 
value, you will need to use the #default_value property rather than #value."

-- 
Scott Reynen
MakeDataMakeSense.com


More information about the development mailing list