开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜