HTML

Summary

  • 提交数据
  • 可以使用 submitButton 的 formaction 属性,提交到不同的方法上。
  • enctype 属性规定在将表单数据发送到服务器之前如何对其进行编码(只有 method="post" 时才使用 enctype 属性)。

HTML

<form name="form名称" action="请求地址"  method="请求类型" enctype ="multipart/form-data">
    <input type="file" name="file">
    <input type="text" name="text">
    <input type="submit" value="提交">
</form>

Grails - GSP

<g:form controller="word" action="saveAll" method="POST">
    <g:textArea name="field_text" value="在这里输入你需要的内容" class="form-control" rows="10"/>
    <g:submitButton class="btn btn-xs btn-success btn-outline" name="save" value="保存">保存</g:submitButton>
    <g:submitButton class="btn btn-xs btn-success btn-outline"
                    name="save"
                    value="分词"
    formaction="wordSeg">分词
    </g:submitButton>
</g:form>
原文地址:https://www.cnblogs.com/duchaoqun/p/13082894.html