Webform使用特定页面URL提交

时间:2014-05-05 08:02:24

标签: javascript jquery html webforms business-catalyst

我有一个网站,它有很多投资组合页面。每页都有“联系我们”表格。但是我为每个投资组合使用了一个Web表单模块,因此我遇到问题需要找出from which page customer has submitted the form

我看到很少有网站使用specific page URL on the Email提交表单,然后网站所有者可以识别该页面。

我该怎么办?

我想在网络表单中添加select选项。但由于我们有很多页面,因此网站访问者很难。

<select>
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="mercedes">Mercedes</option>
  <option value="audi">Audi</option>
</select> 

仅供参考:CMS是Business Catalyst。

请告诉我你的建议。

这是我当前的网络表单模块。我可以在BC中免费编辑删除修改网页表单。

<form action="http://www.xxxxxxxxxxx.com.au/FormProcessv2.aspx?WebFormID=42328&amp;OID={module_oid}&amp;OTYPE={module_otype}&amp;EID={module_eid}&amp;CID={module_cid}" enctype="multipart/form-data" onsubmit="return checkWholeForm83244(this)" method="post" name="catwebformform83244">
    <p>Your Name (required)<br />
    <span class=""><input type="text" aria-required="true" class="" size="40" name="FullName" /></span> </p>
    <p>Your Email (required)<br />
    <input type="email" aria-required="true" class="" size="40" name="EmailAddress" /></p>
    <p>Your Phone Number<br />
    <span class=""><input type="tel" class="" size="40" name="WorkPhone" /></span></p>
    <p>On Which Date?<br />
    <span class=""><input type="text" size="40" onfocus="displayDatePicker('CAT_Custom_26272');return false;" style="background-color: #f0f0f0;" readonly="readonly" class="" id="CAT_Custom_26272" name="CAT_Custom_26272" /> </span></p>
    <p>Your Message<br />
    <textarea class="" rows="10" cols="40" name="CAT_Custom_26273"></textarea> </p>
    <p><input type="submit" id="catwebformbutton" class="button" value="Send" /></p>

    <script type="text/javascript" src="http://xxxxxxx.australianwebsitedevelopment.com.au/CatalystScripts/ValidationFunctions.js"></script>
    <script type="text/javascript" src="http://xxxxxxx.australianwebsitedevelopment.com.au/CatalystScripts/Java_DatePicker.js"></script>
    <script type="text/javascript">
//<![CDATA[
var submitcount83244 = 0;function checkWholeForm83244(theForm){var why = "";if (theForm.FirstName) why += isEmpty(theForm.FirstName.value, "First Name"); if (theForm.LastName) why += isEmpty(theForm.LastName.value, "Last Name"); if (theForm.EmailAddress) why += checkEmail(theForm.EmailAddress.value); if (theForm.WorkPhone) why += isEmpty(theForm.WorkPhone.value, "Work Phone Number"); if (theForm.CAT_Custom_26272) if (theForm.CAT_Custom_26272.value.length > 0) why += checkDate(theForm.CAT_Custom_26272.value,"On Which Date?");if(why != ""){alert(why);return false;}if(submitcount83244 == 0){submitcount83244++;theForm.submit();return false;}else{alert("Form submission is in progress.");return false;}}
//]]>
</script>
</form>

1 个答案:

答案 0 :(得分:2)

假设你正在使用jQuery,你可以这样做:

HTML:

<input type="hidden" id="sourcePage" name="sourcePage" />

jQuery:

$(document).ready(function(){ // if you didn't set it before
  var docHref = document.URL;     
  $('#sourcePage').attr('value', docHref);  
});

这会将当前网址添加到输入值中,这样您就可以将此数据发送到表单。