开发者

using buttons instead of input type="submit" in rails

开发者 https://www.devze.com 2023-03-30 19:05 出处:网络
I have a form that submits data. Before I had used the submit_tag however, that converts to <input type=\"submit\"

I have a form that submits data.

Before I had used the submit_tag however, that converts to <input type="submit"

I wanted the buttons to 开发者_开发百科look prettier so now I've started using <button> <span>login</span></button>

How can I submit the form using button the same way it was submitting with input type=submit ?


You could add a JavaScript event handler that obtains a reference to the form and submits it when the <button> element is clicked.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号