# \<button type="button"

**URL:** <https://www.ruby-forum.com/t/button-type-button/189630>\
**Category:** Rails\
**Created:** [June 4, 2010, 6:40am UTC](https://www.ruby-forum.com/t/button-type-button/189630 "2010-06-04T06:40:16Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tom-mac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/bc8723/32.png) [@tom-mac](https://www.ruby-forum.com/u/tom-mac)\
**Post date:** [June 4, 2010, 6:40am UTC](https://www.ruby-forum.com/t/button-type-button/189630/1 "2010-06-04T06:40:16Z")

</div>

Hi  
I would like to construct a button like  
Add

And I used the helper button\_to\_remote for this like

\<%= button\_to\_remote(“Add”,  
{ :url =\> some\_url(@id),  
:condition =\> “check\_valid()”,  
:with=\> “‘ids=’+user\_ids”},  
{:class =\> “form-button2 fixed3”}  
) %\>

```
   I get the functionality correctly But it produces html like

```

\<input type"button" class=“form-button2 fixed3”…/\> So  
ignoring css style

Please tell me which helper to use to get html like \<button  
type=“button”…

Thanks in advance  
Tom

---

<div class="post-metadata">

**Author:** ![tom-mac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/bc8723/32.png) [@tom-mac](https://www.ruby-forum.com/u/tom-mac)\
**Post date:** [June 4, 2010, 1:59pm UTC](https://www.ruby-forum.com/t/button-type-button/189630/2 "2010-06-04T13:59:59Z")

</div>

Hi  
Did not get ny reply. Please help. It is urgent

Tom

---

<div class="post-metadata">

**Author:** ![tom-mac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/bc8723/32.png) [@tom-mac](https://www.ruby-forum.com/u/tom-mac)\
**Post date:** [June 4, 2010, 2:30pm UTC](https://www.ruby-forum.com/t/button-type-button/189630/3 "2010-06-04T14:30:11Z")

</div>

Tom M. wrote:

> Hi  
> Did not get ny reply. Please help. It is urgent
> 
> Tom

Bumping after 5 hours doesn’t make people want to help you.

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![tom-mac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/bc8723/32.png) [@tom-mac](https://www.ruby-forum.com/u/tom-mac)\
**Post date:** [June 7, 2010, 5:44am UTC](https://www.ruby-forum.com/t/button-type-button/189630/4 "2010-06-07T05:44:20Z")

</div>

Hi  
You are right. But still the problem. Please help if possible

Tom

---

<div class="post-metadata">

**Author:** ![tom-mac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/bc8723/32.png) [@tom-mac](https://www.ruby-forum.com/u/tom-mac)\
**Post date:** [June 7, 2010, 10:49am UTC](https://www.ruby-forum.com/t/button-type-button/189630/5 "2010-06-07T10:49:07Z")

</div>

I don’t think there is a method you’ll be able to use to generate a  
 tag. There seem to be some compatibility issues with that  
tag. I guess you have your reasons to be using instead of  
. In any case, since the call to button\_to\_remote  
will just generate a string that will be passed back to the browser as  
html maybe you can just hack something with a regex and manipulate the  
result of button\_to\_remote to replace the initial ‘\<input’ with  
‘\<button’. I don’t know if that will work but it could be worth a try?

---

<div class="post-metadata">

**Author:** ![tom-mac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/bc8723/32.png) [@tom-mac](https://www.ruby-forum.com/u/tom-mac)\
**Post date:** [June 7, 2010, 10:56am UTC](https://www.ruby-forum.com/t/button-type-button/189630/6 "2010-06-07T10:56:09Z")

</div>

On 4 June 2010 05:40, Tom M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> :with=> "'ids='+user_ids"},
> 
> ```
> 
> {:class =\> “form-button2 fixed3”}  
> ) %\>
> 
> ```
> I get the functionality correctly But it produces html like
> 
> ```
> 
> \<input type"button" class=“form-button2 fixed3”…/\> So  
> ignoring css style
> 
> Please tell me which helper to use to get html like \<button  
> type=“button”…

You can always just put the raw html in yourself.

Colin

---

<div class="post-metadata">

**Author:** ![tom-mac](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/bc8723/32.png) [@tom-mac](https://www.ruby-forum.com/u/tom-mac)\
**Post date:** [June 7, 2010, 11:00am UTC](https://www.ruby-forum.com/t/button-type-button/189630/7 "2010-06-07T11:00:13Z")

</div>

Hi  
Finally I solved like

Add

And may I conclude that there is no helper which gives exact raw html  
like \<button type="button

Tom
