在验证表单中的所有字段后,我想重定向到另一个页面。我在 CSS 中这样做。我想在 CSS 中验证后触发重定向方法。
我在网上看到我们可以使用:
window.location = "https://www.asdfg.com" //Something like this
<style>
div.selectBox
{position:relative;display:inline-block;cursor:default;
text-align:left;lineheight:30px;clear:both;color:#888;}
span.selected
{width:167px;text-indent:20px;border:1px solid #ccc;border-right:none;border-top-left-radius:5px;
border-bottom-left-radius:5px;background:#FFFFFF;overflow:hidden;}
span.selectArrow
{width:30px;border:1px solid #FFFFFF;border-top-right-radius:4px;border-bottom- right-radius:4px;
text-align:center;font-size:20px;-webkit-user-select: none;-khtml-user-select: none;
-moz-user-select: none; -o-user-select: none;user-select: none;background:#FFFFFF;}
span.selectArrow,span.selected
{位置:相对;浮动:左;高度:30px;z-index:1;}
div.selectOptions
{position:absolute;top:28px;left:0;width:198px;border:1px solid #ccc;border-bottom- right-radius:5px;
border-bottom-left-radius:5px;overflow:hidden;background:#FFFFFF;padding-top:2px;display:none;}
span.selectOption
{display:block;width:80%;line-height:20px;padding:5px 10%;}
span.selectOption:hover
{color:#ffffff; background:#4096ee;}
</style>
<body>
<h1>Registration form</h1>
<form id=payment>
<fieldset>
<legend>Account Information</legend>
<ol>
<li><input id=name name=name size="40" type=text placeholder="User Name" required autofocus></li>
<li><input id=email name=email type=email placeholder="Password" required></li>
<li><input id=phone name=phone type=tel placeholder="Verify Password" required></li>
</ol>
</fieldset>
<fieldset>
<legend>User Details</legend>
<ol>
<li><input id=name name=name type=text placeholder="First Name" required autofocus> </li>
<li><input id=name name=name type=text placeholder="Last Name" required autofocus></li>
<li><input id=name name=name type=text placeholder="Email ID" required autofocus></li>
<li><input id=email name=email type=email placeholder="Company" required></li>
<li><input id=phone name=phone type=tel placeholder="Telephone No" required></li>
</div>
</li>
<li>
<button type=submit>Register</button>
</fieldset>
</form>
</section>
</div>
</body>