【发布时间】:2016-12-19 07:26:32
【问题描述】:
首先该站点是http://emiralmedia.com/site/tennishero,它只是用于在将站点启动到单独的域之前对其进行测试。
您好,我想通过 stackoverflow 帮助更改 CRM 联系表单的响应错误,我设法将其集成到 wordpress 中。该表单与 javascript 链接,以将从 wordpress 站点表单发送的消息与另一个平台集成。 (客户关系管理)。 现在我有这个联系表格的代码:
<div class="main-content">
<div class="form-mini-container">
<form FormHash="29074-1vmo1w4eti26ekzhtj8e" action="https://r3.minicrm.ro/Api/Signup" method="post" class="form-mini">
<div class='form-row'>
<input name="Contact[1181][LastName]" id="Contact_LastName_1181" language="RO" type="text" placeholder="Name and surname" />
</div>
<div class='form-row'>
<input name="Contact[1181][Phone]" id="Contact_Phone_1181" language="RO" type="text" placeholder="Phone" />
</div>
<div class='form-row'>
<input name="Contact[1181][Email]" id="Contact_Email_1181" language="RO" type="text" placeholder="Email" />
</div>
<div id="Response_29074-1vmo1w4eti26ekzhtj8e" style="display: none;" class="Response raspuns"></div>
<input id="Submit_29074-1vmo1w4eti26ekzhtj8e form-row form-last-row" type="Submit" value="LET´S GET IN TOUCH" class="button2">
</form>
</div>
</div>
当我想发送带有联系表格的消息并且忘记添加“姓名”、“电话”或“电子邮件”时,它会向我发送其他语言的 ResponseError,例如:
<span class="ResponseError" style="transition: none; line-height: 0px; border-width: 0px; margin: 0px; padding: 0px; letter-spacing: 0px; font-weight: 400; font-size: 14px;">Name and surname este obligatoriu</span>
我想用我的自定义消息更改消息....而不是 CRM 的默认消息。当您尝试发送消息时会出现跨度。我猜来自javascript。 https://r3.minicrm.ro/api/minicrm.js?t=1470730609
我尝试制作这个脚本,但没有任何效果。
if (window.location.pathname == '/site/tennishero/') {
jQuery('.Response span').each(function() {
if (jQuery(this).text() == 'Name and surname este obligatoriu') jQuery(this).text('Name si required');
});
}
if (window.location.pathname == '/site/tennishero/') {
jQuery('.Response span').each(function() {
if (jQuery(this).text() == 'Telefon este obligatoriu') jQuery(this).text('Phone is required');
});
}
if (window.location.pathname == '/site/tennishero/') {
jQuery('.Response span').each(function() {
if (jQuery(this).text() == 'Email este obligatoriu') jQuery(this).text('Email is required');
});
}
有什么想法吗?谢谢。
【问题讨论】:
-
将代码放入处理AJAX响应并将span添加到DOM的函数中。
标签: javascript php jquery html wordpress