Hi, I''ve a form field with the id "foo-bar" and I can get the value from this field with $F(''foo-bar''), but it is not possible to set the value with $F(''foo-bar'') = ''foo bar''. If I use $(''foo-bar'').value = ''foo bar'' there is no problem. Example: http://test.dirkeinecke.de/prototype/f.html Any ideas? Is this a bug? greetings Dirk Einecke --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Dirk Einecke a écrit :> Hi, > > I''ve a form field with the id "foo-bar" and I can get the value from > this field with $F(''foo-bar''), but it is not possible to set the value > with $F(''foo-bar'') = ''foo bar''. If I use $(''foo-bar'').value = ''foo > bar'' there is no problem. > > Example: > http://test.dirkeinecke.de/prototype/f.html > > Any ideas? Is this a bug?Do you know of any language that lets you do fx(blah) = thing!? $F returns the value, not a reference to the field''s value structure, which varies from one field to another. Use the field''s appropriate DOM properties for setting. -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hi,> Do you know of any language that lets you do fx(blah) = thing!? > > $F returns the value, not a reference to the field''s value structure,Okay. I''ll use $(''foo-bar'').value = ''foo bar'' ... greetings Dirk Einecke --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
OFF TOPIC warning! You can actually do fx(blah) = thing in C++ using references. :) int var = 0; int& test() { return var; } test() = 4; Sorry, just had to mention that. :) On 2/11/07, Christophe Porteneuve <tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote:> > Do you know of any language that lets you do fx(blah) = thing!? > > $F returns the value, not a reference to the field''s value structure, > which varies from one field to another. Use the field''s appropriate DOM > properties for setting. > > -- > Christophe Porteneuve a.k.a. TDD > "[They] did not know it was impossible, so they did it." --Mark Twain > Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve
2007-Feb-12 13:33 UTC
[OT] Re: [Rails-spinoffs] Re: Problem with Dollar F Function
Hey Andrew (btw, that''s how you markup an OT post, in case you wondered), Andrew Kaspick a écrit :> You can actually do fx(blah) = thing in C++ using references. :)Totally, but whoever does that without overloading an operator like [] to make it less ugly will face my wrath in the next world :-) However, it does come handy. Consider the STL''s map::operator[] method. I just love being able to create a lexicon with stuff like: string word; map<string, unsigned> lexicon; while (cin >> word) ++lexicon[word]; But MAN, "obj.method(param) = newValue"? YEEWWWH! Just aesthetically, you know. Hey, there''s no accounting for taste. Actually, I don''t think at all that C++ is the only one letting you do that, since all it takes is letting methods return references, and having a good/lax enough parser that it will grok such stuff. -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---