Submit form using a button outside the <form> tag

前端 未结 13 1226
南旧
南旧 2020-11-22 09:45

Say I have:

相关标签:
13条回答
  • 2020-11-22 10:30

    Maybe this could work, but I don't know if this is valid HTML.

    <form method="get" action="something.php">
        <input type="text" name="name" />
        <input id="submitButton" type="submit" class="hide-submit" />
    </form>
    
    <label for="submitButton">Submit</label>
    
    0 讨论(0)
提交回复
热议问题