Any other way to do delete confirmation?

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

Alex W. wrote:

Victor F. 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

Victor F. 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!’)”})

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