<button type="button"

Hi
   I would like to construct a button like
<button type="button" onclick="javascript:test();" class="form-button2
fixed3"><span>Add </span></button>

And I used the helper button_to_remote for this like

<%= button_to_remote("<span>Add</span>",
        { :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

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

Tom

Tom Mac 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,

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

Tom

I don't think there is a method you'll be able to use to generate a
<button> tag. There seem to be some compatibility issues with that
tag. I guess you have your reasons to be using <button> instead of
<input type="button">. 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?

You can always just put the raw html in yourself.

Colin

Hi
   Finally I solved like

  <button type="button" onclick="if (check_valid()) {
            new Ajax.Request('<%= some_url(@id) %>', {
asynchronous:true,
            evalScripts:true,
            parameters:'ids='+user_ids
           });};" class="form-button2 fixed3"><span>Add </span></button>

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

Tom