# Confirm option on submit\_tag -- not working

**URL:** <https://www.ruby-forum.com/t/confirm-option-on-submit-tag-not-working/141618>\
**Category:** Rails\
**Created:** [June 27, 2008, 8:14pm UTC](https://www.ruby-forum.com/t/confirm-option-on-submit-tag-not-working/141618 "2008-06-27T20:14:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![djlewis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7bcc69/32.png) [@djlewis](https://www.ruby-forum.com/u/djlewis)\
**Post date:** [June 27, 2008, 8:14pm UTC](https://www.ruby-forum.com/t/confirm-option-on-submit-tag-not-working/141618/1 "2008-06-27T20:14:08Z")

</div>

I’m getting an incorrect result with the confirm option of submit  
buttons. This source…

```
  <%= button_to "Submit entire questionnaire", {},
    :confirm => "Are you sure? You will not be able to make any

```

more changes.",  
:id =\> ‘button-submit-entire’  
%\>

generates this html, whcih works fine…

But this source…

```
<%= submit_tag "Submit entire questionnaire",
  :name => :submit_submit,
  :id => :submit_submit,
  :class => :submit_nav,
  :confirm => "Are you sure? You will not be able to make any more

```

changes."  
%\>

generates this html, which looks wrong and does not do the  
confirmation…

Rails bug? My error?

Thanks. --David.

---

<div class="post-metadata">

**Author:** ![djlewis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7bcc69/32.png) [@djlewis](https://www.ruby-forum.com/u/djlewis)\
**Post date:** [June 27, 2008, 10:08pm UTC](https://www.ruby-forum.com/t/confirm-option-on-submit-tag-not-working/141618/2 "2008-06-27T22:08:22Z")

</div>

On Jun 27, 2008, at 11:02 AM, djlewis wrote:

> generates this html, which looks wrong and does not do the  
> confirmation…
> 
> Rails bug? My error?

What version of Rails? Looks like 2.1 has this feature. 1.2.5 does  
not. (that’s what I have local docs for, hence those versions).

-philip

---

<div class="post-metadata">

**Author:** ![djlewis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7bcc69/32.png) [@djlewis](https://www.ruby-forum.com/u/djlewis)\
**Post date:** [June 28, 2008, 7:59am UTC](https://www.ruby-forum.com/t/confirm-option-on-submit-tag-not-working/141618/3 "2008-06-28T07:59:05Z")

</div>

Ahh… using 2.0.2. I had problems deploying in 2.1. OK, I’ll build  
it by hand – not hard. Guess I’d better not use the 2.1 docs.

Thanks. --David.
