【问题标题】:how can i get my submit button to hide and then show only when all the information is filled?我怎样才能让我的提交按钮隐藏,然后仅在填写所有信息时才显示?
【发布时间】:2020-06-13 19:20:24
【问题描述】:

我想创建一个网站,并且我创建新帐户的提交按钮正在显示,并且无论何时单击都会转到下一页。 我希望仅在此人已填写所有信息时才显示提交按钮。

【问题讨论】:

    标签: html input submit


    【解决方案1】:

    <!DOCTYPE html>
    <html>
    <body>
    
    <input type="submit" id="mySubmit">
    
    <p>Click the "Try it" button to disable the Submit button.</p>
    
    <button onclick="myFunction()">Try it</button>
    
    <script>
    function myFunction() {
      document.getElementById("mySubmit").disabled = true;
    }
    </script>
    
    </body>
    </html>

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-02-05
      • 1970-01-01
      • 2022-11-12
      • 1970-01-01
      • 1970-01-01
      • 2020-02-07
      • 2022-01-21
      相关资源
      最近更新 更多