gpt4 book ai didi

javascript - 表单提交后的通知

转载 作者:太空宇宙 更新时间:2023-11-04 06:09:38 25 4
gpt4 key购买 nike

我有一个将字段输入网站的表单。但我想在提交我的表格后发送一封单独​​的电子邮件,通知客户已提交潜在客户。

此表单收集客户信息并提供给存储所有客户信息的网站。表格的那部分工作完美。我需要创建一个单独的操作或触发器,向电子邮件发送通知,提醒我的客户申请已填写。我尝试过的所有方法要么提交表格而不发送电子邮件,要么发送电子邮件而不提交信息。为了客户的 secret 性,我更改了代码中的信息。

<form action="This is the domain that submits to the website but for client confidentiality i cannot display" method="POST" >

<input type=hidden name="oid" value="00D1U000001ANuJ">
<input type=hidden name="retURL" value="/pages/wholesale-application-thank-you">


<label for="first_name">First Name</label><input id="first_name" maxlength="40" name="first_name" size="20" type="text" class="input-full" placeholder="First Name"/><br>

<label for="last_name" >Last Name</label><input id="last_name" maxlength="80" name="last_name" size="20" type="text" class="input-full" placeholder="Last Name"/><br>

<label for="title" >Title</label><input id="title" maxlength="40" name="title" size="20" type="text" class="input-full" placeholder="Title"/><br>

<label for="company" >Company</label><input id="company" maxlength="40" name="company" size="20" type="text" class="input-full" placeholder="Company"/><br>

<label for="URL" >Website</label><input id="URL" maxlength="80" name="URL" size="20" type="text" class="input-full" placeholder="Website"/><br>

<label for="email" >Email</label><input id="email" maxlength="80" name="email" size="20" type="text" class="input-full" placeholder="Email"/><br>

<label for="street" >Street</label><textarea name="street" class="input-full" placeholder="Street"></textarea><br>

<label for="city" >City</label><input id="city" maxlength="40" name="city" size="20" type="text" class="input-full" placeholder="City"/><br>

<label for="zip" >Zip</label><input id="zip" maxlength="20" name="zip" size="20" type="text" class="input-full" placeholder="Zip"/><br>

<label for="state" >State/Province</label><input id="state" maxlength="20" name="state" size="20" type="text" class="input-full" placeholder="State/Province"/><br>

<label for="lead_source" >Lead Source</label><select id="lead_source" name="lead_source" class="input-full"><option value="">--None--</option><option value="Events">Events</option>
<option value="Facebook">Facebook</option>
<option value="Google">Google</option>
<option value="Instagram">Instagram</option>
<option value="Retailer">Retailer</option>
<option value="Social Media">Social Media</option>
<option value="Third Party Site">Third Party Site</option>
<option value="Trade Publication">Trade Publication</option>
<option value="Trade Shows">Trade Shows</option>
<option value="Twitter">Twitter</option>
<option value="YouTube">YouTube</option>
</select><br>


<input type="submit" name="submit" >
</form>

最佳答案

您是否尝试过向表单添加一个 submit 事件监听器?沿着这些线的东西:

document.addEventListener('submit', (event) => {
event.preventDefault();
if (event.target.id === 'form-id') { // you'll need to give your form an id
// do something like send an email
};
};

关于javascript - 表单提交后的通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56533991/

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