Business Catalyst Web窗体错误

时间:2014-07-21 07:55:42

标签: business-catalyst

我已经开始使用Adobe Business Catalyst,我正在使用BC生成的Web表单调整现有的HTML Web表单。即使我在Adobe Community Forums阅读此文件后添加了FirstName和LastName文本字段,说明这对于Adobe CRM是强制性的,但仍然会出现错误:ERROR: An error occurred. Your web form must capture customer name and email address. Please fix this issue and re-insert your web form on your web page.以下是当前表单:

<form name="catwebformform81533" method="post" onsubmit="return checkWholeForm81533(this)" 
            enctype="multipart/form-data" action="http://domain.businesscatalyst.com/FormProcessv2.aspx?WebFormID=74594&OID={module_oid}&OTYPE={module_otype}&EID={module_eid}&CID={module_cid}" id="form">
            <div class="span4">
<input type="text" name="FirstName" id="FirstName" class="cat_textbox" maxlength="255" value="ingevuld"/> 
<input type="text" name="LastName" id="LastName" class="cat_textbox" maxlength="255" value="ingevuld" />
                <div class="field">
                    <label>Name:</label>
                    <input type="text" name="name" value="" id="name"/>
                </div>
                <div class="field">
                    <label>Email:</label>
                    <input type="text" name="email" value="" id="email" />
                </div>
                <div class="field">
                    <label>Subject:</label>
                    <input type="text" name="subject" value="" name="CAT_Custom_343661" id="CAT_Custom_343661" />
                </div>
            </div>

            <div class="span4">
                <div class="field">
                    <label>Message:</label>
                    <textarea rows="7" name="CAT_Custom_343660" id="CAT_Custom_343660" 
                    onkeydown="if(this.value.length>=4000)this.value=this.value.substring(0,3999);"></textarea>
                </div>
                <div class="field">
                {module_recaptcha}
                </div>
                <div class="submitbutton clearfix">
                    <input type="submit" value="Send Your Message" class="m-btn red rnd right"/>
                </div>
            </div>
                <script type="text/javascript" src="http://domain.businesscatalyst.com/CatalystScripts/ValidationFunctions.js">
                </script><script type="text/javascript">
//<![CDATA[
var submitcount81533 = 0;function checkWholeForm81533(theForm){var why = "";
if (theForm.email) why += checkEmail(theForm.email.value);
if (theForm.CAT_Custom_343661) why += isEmpty(theForm.CAT_Custom_343661.value, "Subject");
if (theForm.CAT_Custom_343660) why += isEmpty(theForm.CAT_Custom_343660.value, "Message");
if(why != ""){alert(why);return false;}if(submitcount81533 == 0){submitcount81533++;
theForm.submit();return false;}else{alert("Form submission is in progress.");return false;}}
//]]>
</script>
            </form>

我添加了FirstName和LastName字段的值,并用CSS隐藏它们只是为了安抚Adobe必填字段。虽然没有快乐。我应该调整什么想法?

3 个答案:

答案 0 :(得分:1)

似乎我必须更改电子邮件地址的ID和该字段的名称:

<input type="text" name="EmailAddress" value="" id="EmailAddress"  />

与此验证一起

script type="text/javascript" src="http://domain.businesscatalyst.com/CatalystScripts/ValidationFunctions.js"></script>
                <script type="text/javascript">
//<![CDATA[
var submitcount16251 = 0;function checkWholeForm16251(theForm){var why = "";
if (theForm.EmailAddress) why += checkEmail(theForm.EmailAddress.value); 
if (theForm.FirstName) why += isEmpty(theForm.FirstName.value, "First Name");
if (theForm.LastName) why += isEmpty(theForm.LastName.value, "Last Name"); 
if(why != ""){alert(why);return false;}if(submitcount16251 == 0){submitcount16251++;
theForm.submit();
return false;}else{alert("Form submission is in progress.");return false;}}
//]]>
</script>

<强>全名

您还可以将名字与姓氏结合使用,这样您就不需要两个单独的字段,我几乎不会将其用于客户端。请参见链接here。输入字段为

<input type="text" name="FullName" id="FullName" class="cat_textbox" maxlength="255" />

<强>的ID

我还调整了不同的标签ID号,因为我使用了两个生成表单中的ID。这不是必需的,因为您要求HTML添加的一个表单将在每次执行此操作时为所有几个标记分配新的ID。但验证更改和电子邮件标签更改确实有所帮助。这确保在同一页面上加载了感谢您。还要确保WebFormID与后端中现有的创建的Webform相关!

系统确认页

只有我为加载的样式表和javascripts添加了几个404,并且加载了没有样式的页面。这是因为系统确认页面试图加载一些不存在的样式表。最后通过创建一个新模板来解决这个问题并不是很难。

答案 1 :(得分:0)

只需从代码中删除这两行

即可
if (theForm.FirstName) why += isEmpty(theForm.FirstName.value, "First Name");
if (theForm.LastName) why += isEmpty(theForm.LastName.value, "Last Name");

所以BC不会检查它们是否已被填满

答案 2 :(得分:-1)

如果你想创建一个没有电子邮件地址的表单,你可以使用这个代码至少然后最终用户不会看到它。您所做的只是填充电子邮件地址表单字段,然后使用visibility:hidden;隐藏它。事实上,他们内部的电子邮件地址使其通过表单验证。要在输入标记中使用它:

type =“text”style =“visibility:hidden”name =“EmailAddress”value =“me@hotmail.com”id =“EmailAddress”