HTML所有字段都不起作用

时间:2017-06-14 00:51:35

标签: html

如果所有字段都填写为所需的8个最小字符并且正在检查单选按钮,如何使表单的提交按钮找到新页面。当我填写字段或将其留空时,提交按钮不执行任何操作。感谢您的任何建议。

HTML:

<form id="form1" method="POST" action=""><br>

    <h6>Sign up using the form below...</h6><br>
    <label>
        Desired user name: <br>
        <input type="text" name="username" size="15" minlength="8" maxlength="30" required title="8 characters minimum" required />
    </label><br>
    <label>
        Password: <br>
        <input type="password" name="password" size="15" minlength="8" maxlength="30"  required title="8 characters minimum" required/>
    </label><br>
    <label>
        Repeat Password: <br>
        <input type="password" name="password" size="15" minlength="8" maxlength="30" required title="8 characters minimum" required/>
    </label><br><br>

    <input type="checkbox" name="agree" required/> I agree to the terms and service of this website<br><br>

    <input class="account" type="submit" name ="Submit" value="Submit" formnovalidate onClick="window.location = 'http://www.google.com';"/><br><br>
    </form>

1 个答案:

答案 0 :(得分:0)

formnovalidate正在创建问题,请尝试一下。

<form id="form1" action="https://www.google.com"><br>

    <h6>Sign up using the form below...</h6><br>
    <label>
        Desired user name: <br>
        <input type="text" name="username" size="15" minlength="8" maxlength="30" required title="8 characters minimum" required />
    </label><br>
    <label>
        Password: <br>
        <input type="password" name="password" size="15" minlength="8" maxlength="30"  required title="8 characters minimum" required/>
    </label><br>
    <label>
        Repeat Password: <br>
        <input type="password" name="password" size="15" minlength="8" maxlength="30" required title="8 characters minimum" required/>
    </label><br><br>

    <input type="checkbox" name="agree" required/> I agree to the terms and service of this website<br><br>

    <input class="account" type="submit" name ="Submit" value="Submit"/><br><br>
    </form>