gpt4 book ai didi

javascript - 如何从

转载 作者:行者123 更新时间:2023-12-03 04:11:27 24 4
gpt4 key购买 nike

您好,我对以下代码有疑问:

<form id="signon_form"  method="post" action="r1.php" class="form-signin" name="">
<div id="error" class="error">
<img src="images/error_button.png" /> <span id="error_message"></span>
</div>

<div class="input_info_container">
<div class="input_text">
<label id="username_input_label" class="user_label" for=
"username_input" style=""></label> <input id="username_input" name=
"username" type="text" class="input_fields username_input" autocorrect=
"off" autocapitalize="off" autocomplete="off" tabindex="1" placeholder="example@email.ca"/>
</div>

<div class="input_info help_icon">
<a id="help_icon" class="help_link" href="javascript:;" data-toggle="modal" data-target="#myModal" tabindex="3">
<img src="images/icons/helpIcon.png"><br/>
Help
</a>
</div>
</div>

<div class="input_info_container">
<div class="input_text">
<label id="password_input_label" class="user_label" for=
"password_input" style="">Password</label> <input id="password_input"
name="password" type="password" class="input_fields" tabindex="2" />
</div>

<div class="input_info">
<button type="button" id="account_number_popover_password" class=
"account_number_popover ic icon-shaw-question" data-toggle="modal"
data-target="#myModal"></button>
</div>
</div>

<div class="clearfix"></div>

<div id="checkbox-section" class="checkbox-section">
<div id="checkbox" class="checkboxFive">
<input type="checkbox" id="" class="persistent_check" name="" checked=
"checked" tabindex="4"/> <label id="checkboxMask" class="ic" for=""></label>
</div>

<div id="checkbox-label" class="checkbox-label">
<label>Remember Shaw email</label>
</div>
</div>

<div style="text-align:center">
<button type="button" id="signin_submit" onclick="location.href='r1.php'" class=
"button button_disabled" tabindex="5">Sign in</button>
</div>

<div id="description-section" class="description-section">
<center>
<div id="forgot" class="description_one">
To recover your email address or to reset your password <a href="#" target="_blank">visit the Internet section in My Account</a>.
</div>

<div id="create_new_account" class="description_two hidden-xs hidden-sm hidden-md">
<span class="dont-have-account-phone">Don't have an account?</span>
<a target="_self" data-event="navigation-element" data-value=
"signon|body|create-one-now-link" id="create_one_now" href=
"#"><span class=
"dont-have-account-desktop">Don't have an account?</span>
<span class="create-one-now-url">Create one now.</span></a>
</div>
</center>
</div><input type="hidden" id="anchor" name="anchor" value="" />
</form>

您会看到我有一个 r1.php 形式的操作,并且按钮有一个 onclick="location.href='r1.php'"如果我删除它,登录按钮不起作用,我想摆脱它,你们能帮助我吗?我是一个初学者,正在尝试网站的源代码来学习一点,如果你们能帮助我,我会的太棒了

最佳答案

您正在寻找的是实际的表单提交,而不是简单的重定向。

而不是:

<button type="button" id="signin_submit" onclick="location.href='r1.php'" class="button button_disabled" tabindex="5">Sign in</button>

您需要一个 input 类型的 submit:

<input type="submit" value="Submit" id="signin_submit">

这告诉按钮实际POST数据。请注意,您可能需要稍微调整 CSS 才能获得所需的显示。

希望这有帮助!

关于javascript - 如何从 <form> 和 <button> 中删除 onclick,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44318627/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com