Javascript Confirm for Form Value

How could I ask a user to confirm specific form input?


<%= f.submit 'Donate', :confirm => 'Confirm your donation amount:
###amount###' %>

Where the ###amount### would be replaced with the amount entered in
the form.


Typically you would place the confirmation on the form, not an input
field. Is there a reason the confirmation on the form would not work?

Darian Shimy

Thanks for the reply.

The confirmation is on the submit button. The confirmation works on
submit but I wasn't sure if you could add something more to the
confirmation besides static text such as "Are you sure you want to
delete?" I would like it if I could display a value in the
confirmation. So when a user finally submits the form it would confirm
a value they entered in a text box above.

Does that make sense?


Yes. The only way I'm aware of is to use the :onclick and access the
value with javascript (this.form....).

Darian Shimy