HTML表单提交后打开新选项卡,如果只是在当前选项卡上重定向,则首选



我已经通过GetForm将以下表单代码块插入到我的Squarespace网站中——但是,一旦提交表单,就会打开一个新的选项卡,重定向到GetForm的"谢谢"页面。与其打开另一个选项卡,我希望它在当前选项卡上重定向到"谢谢"页面——或者,如果可能的话,只需让表单本身显示一个"谢谢,您的提交已收到",而不进行重定向。此外,一旦提交了表格,输入到表格中的信息仍然存在,是否可以在提交后"重置"表格或清除输入的信息?

当涉及到任何与编码相关的内容时,我都是一个完全的新手,我已经从各种谷歌搜索以及GetForm网站中拼凑出了表单的代码——非常感谢任何帮助,谢谢!

<div class="form-container">
<div class="title">Apply Now!</div>
<form accept-charset="UTF-8" action="https://getform.io/f/061fe877-cd4b-4e98-9f70-f5fb2eeb3716" method="POST" target="_blank" enctype="multipart/form-data">

<div class='form-field'><label class='form-label'>Full Name:</label>
<div class="form-input-container">
<input class="form-input" type="text" name="full_name" required>
</div>
</div>
<div class='form-field'><label class='form-label'>Email Address:</label>
<div class="form-input-container">
<input class="form-input" type="email" name="email" required>
</div>
</div>
<div class='form-field'><label class='form-label'>Upload Resume & Cover Letter:</label>
<div class="form-input-container">
<input class="form-input" type="file" name="file" required>
</div>
</div>
<button class="form-button" type="submit">SUBMIT</button>
</form>
</div>
<style>
.form-container {
border-radius: 5px;
background-color: #005019;
padding: 20px;
width: 95%;
}
.title {
font-family: "Celias", "Helvetica Neue", Helvetica, Arial, sans-serif;
text-align: center;
text-transform: uppercase;
font-size: 2em;
font-weight: bold;
letter-spacing: .05em;
padding-bottom: 1em;
}
.form-label {
font-family: "Celias", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 15px;
line-height: 1.42857143;
color: #FFFFFF;
box-sizing: border-box;
display: inline-block;
max-width: 100%;
margin-top: 5px;
margin-bottom: 5px;
font-weight: bold;
}
.form-input {
box-sizing: border-box;
font: inherit;
font-family: "Celias", "Helvetica Neue", Helvetica, Arial, sans-serif;
width: 100%;
height: 45px;
padding: 10px 15px;
font-size: 15px;
color: #2c3e50;
background-color: #ffffff;
border: 1px solid #dce4ec;
border-radius: 4px;
border-width: 2px;
}
.form-button {
border: none;
font-size: 16px;
margin-top: 15px;
font-weight: 800;
line-height: 1.5;
border-radius: 3px;
padding: 16px;
background-color: #7BBF42;
color: #FFFFFF;
width: 100%;
text-align: center;
cursor: pointer;
-webkit-transition: all .15s ease;
transition: all .15s ease;
}
</style>

我认为问题是由于将数据发布到getform网站后,没有重定向页面造成的。我认为你需要了解如何在表单提交后进行重定向。

最新更新