Ok, I am a total n00b when it comes to this stuff, but am working as a designer on a project built on ror. Here''s my question. I want to add js tooltips to pop up when a form field is focused on. This is easy enough...have the script running, works fine. The problem is, how do I add the necessary value (tooltiptext) into the form field. For example, I would like to do something like this: <%= text_field ''person'', ''name'', :class => ''formtext'' , :tooltiptext = > ''This is the text'' %> But obviously ror doesn''t understand tooltiptext...is there some way to just append an html value (i.e. tooltiptext=x) to the text field call? Or another workaround? Thanks in advance. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
are you taking about the off-yellow box that the browser shows you when you mouse over something? or are you talking about a homemade tooltip solution? if it''s the first, it is the ''title'' attribute, so you would want to do :title => ''look at me!'' in the html options for the tag. however, i believe IE will show you the alt attribute, so if you do both :alt and :title, you should be safe. On 2/2/07, Matt Mueller <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Ok, I am a total n00b when it comes to this stuff, but am working as a > designer on a project built on ror. Here''s my question. > > I want to add js tooltips to pop up when a form field is focused on. > This is easy enough...have the script running, works fine. The problem > is, how do I add the necessary value (tooltiptext) into the form field. > > For example, I would like to do something like this: <%= text_field > ''person'', ''name'', :class => ''formtext'' , :tooltiptext = > ''This is the > text'' %> > > But obviously ror doesn''t understand tooltiptext...is there some way to > just append an html value (i.e. tooltiptext=x) to the text field call? > Or another workaround? > > Thanks in advance. > > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
No, I am talking about a homemade solution. So title and alt attributes won''t work. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
well then you are going to have to rely on using the element events to show/hide your tooltips something like: <%= text_field ..., :onfocus => "show_tooltip(...)", :onblur => "hide_tooltip(...)" %> i don''t know how you are implementing your tooltips so i can''t really provide more than that. On 2/2/07, Matt Mueller <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > No, I am talking about a homemade solution. So title and alt attributes > won''t work. > > > > > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---