[development] Node limbo
jeff at ayendesigns.com
jeff at ayendesigns.com
Sun Apr 24 23:58:42 UTC 2011
Scott, that was it! I have to admit I was a little dubious. I'm setting
the value in jquery with $(myselector).val(newvalue), and thought,
"There's no jquery .default_value" ... so that the note was referring,
of course, to the form setting. What I don't understand is (a) why the
value was in form-myfield-#post-myfield when I used #value (so
-something- knew about it) and (b) how setting the value differently on
its way to the client can make a difference when it's being reset on the
client side with .val() The only thing I can think of is that when
#value is used it's being marked as read-only in some way, and even
though #post contains the new value, it's being reset to the original at
some point.
Thanks again,
Jeff
On 04/24/2011 07:28 PM, Scott Reynen wrote:
>
> 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."
>
More information about the development
mailing list