hi, i''m in a restful mode and i''ve a delete link. In this case i want to use a link, because i like it more than a button, but to do a delete method the user should have javascript actived..otherwise it won''t work... so, how can i show the link when javascript is actived and a button in the other case? or there is another method to do it simple and always with a link? thanks -- 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 -~----------~----~----~----~------~----~------~--~---
john wrote:> hi, i''m in a restful mode and i''ve a delete link. In this case i want to > use a link, because i like it more than a button, but to do a delete > method the user should have javascript actived..otherwise it won''t > work... so, how can i show the link when javascript is actived and a > button in the other case? or there is another method to do it simple and > always with a link? > thanksanyone? :( -- 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 -~----------~----~----~----~------~----~------~--~---
s.ross
2007-Apr-15 22:08 UTC
Re: :delete => Button, link and javascript...how can i do this?
I''ve never tried this, but how about: function setButtonToLink() { $(''yourButtonId'').replace('' path/you/want/to/link/to your link ''); } function onLoad() { setButtonToLink(); } If js is not enabled, the button would be a button. If js is enabled, it would be replaced with your link. Right? David Smit-2 wrote:> > > hi, i''m in a restful mode and i''ve a delete link. In this case i want to > use a link, because i like it more than a button, but to do a delete > method the user should have javascript actived..otherwise it won''t > work... so, how can i show the link when javascript is actived and a > button in the other case? or there is another method to do it simple and > always with a link? > thanks > > -- > Posted via http://www.ruby-forum.com/. > > > > >-- View this message in context: http://www.nabble.com/%3Adelete-%3D%3E-Button%2C-link-and-javascript...how-can-i-do-this--tf3575862.html#a10007306 Sent from the RubyOnRails Users mailing list archive at Nabble.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 -~----------~----~----~----~------~----~------~--~---
Steve Ross wrote:> I''ve never tried this, but how about: > > function setButtonToLink() > { > $(''yourButtonId'').replace('' path/you/want/to/link/to your link ''); > } > > function onLoad() > { > setButtonToLink(); > } > > If js is not enabled, the button would be a button. If js is enabled, it > would be replaced with your link. > > Right? >thanks, i''ll try :) -- 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 -~----------~----~----~----~------~----~------~--~---