Hi all, For delete confirmation, are there any other ways beside using the ":confirm => ''Are you sure?''" option? At least I want the default option to be cancel instead of OK in the pop-up. Thank you very much Victor -- 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 -~----------~----~----~----~------~----~------~--~---
Victor Fan wrote:> Hi all, > > For delete confirmation, are there any other ways beside using the > ":confirm => ''Are you sure?''" option? At least I want the default > option to be cancel instead of OK in the pop-up. > > Thank you very much > > VictorYou can insert your own javascript easily. Add a javascript message box on any event in your form and customize to whatever javascript allows. <%= submit_tag ''foo'', :onclick => "alert(''foo!'')" %> or <%= form_tag({:action => ''foo''}, {:onsubmit => "alert(''foo!'')"}) -- 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 -~----------~----~----~----~------~----~------~--~---
Alex Wayne wrote:> Victor Fan wrote: >> Hi all, >> >> For delete confirmation, are there any other ways beside using the >> ":confirm => ''Are you sure?''" option? At least I want the default >> option to be cancel instead of OK in the pop-up. >> >> Thank you very much >> >> Victor > > You can insert your own javascript easily. Add a javascript message box > on any event in your form and customize to whatever javascript allows. > > <%= submit_tag ''foo'', :onclick => "alert(''foo!'')" %> > > or > > <%= form_tag({:action => ''foo''}, {:onsubmit => "alert(''foo!'')"})Thank you Alex, is it possible to do it with link_to? Victor -- 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 -~----------~----~----~----~------~----~------~--~---
Sorry, I meant instead of using Javascript''s confirm pop-up, are there any other ways get confirmation from the user? Since that''s impossible to set default to cancel. Thanks for any ideas or pointers about where I should go. Victor -- 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 -~----------~----~----~----~------~----~------~--~---