<div id="maincontent">
<h1 class="alignLeft">Contact Us</h1>
<div class="section group">
<form method="post" action="contact_us.aspx" onsubmit="javascript:return WebForm_OnSubmit();" id="ctl01">
<div class="aspNetHidden">
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKLTM1MzAxMzE5NWRkDpAgZRUlGJo1udX3/PcuUsBXRWcK6P+Zfp5BcrhjhzU=" />
</div>
<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['ctl01'];
if (!theForm) {
theForm = document.ctl01;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
//]]>
</script>
<script src="/WebResource.axd?d=fWEJMqFOAVC5WxEaaxa-j7qiwf--JWZEy5_tJqjYisuGhXuGO-exH6fgrpPV6KTKOipS48GWqWV-iAR0dG9CFa7PujIuKsAJ6NmQgyOk_u01&t=635374537680526886" type="text/javascript"></script>
<script src="/WebResource.axd?d=TqV9Ufp-3sIQwLSDbJHsdjjs6TCOIUclWAEKbJFvCVSWqQk8Cb7msrfITq2ljFGc8Y852HzFdKrbditLku_MDTXy839FLH9zYwMpYk0cP_Y1&t=635374537680526886" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
function WebForm_OnSubmit() {
if (typeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) return false;
return true;
}
//]]>
</script>
<div class="aspNetHidden">
<input type="hidden" name="__VIEWSTATEGENERATOR" id="__VIEWSTATEGENERATOR" value="0829F5A3" />
<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEdAAY5Y5HJq6edLQQMmWbaCfVqVCDn2pfngd5PSl9R1fd0WEMHZh9ZuPBRie2vA/HfoRIiSOTA7Yef34gp3MH3ZlOZegiQmRHLWmb2TjcB9GFfqjzmltaUM7aEAN+g9cP/m13hKXdE9Tt9DxlTtOhzumCPFXkf0nq3NBWVE3/sSt7W7A==" />
</div>
<div class="col span_1_of_3">
<h3>Leave us a message</h3>
<p class="dotted_bg"></p>
<p align="right" class="marNone"><font class="man_txt">*</font> fields are mandatory</p>
<label>Name <font class="man_txt">*</font></label>
<input name="txtname" type="text" id="txtname" class="textbox" />
<span id="reqName" style="color:Red;visibility:hidden;">Please enter your name!</span>
<span id="regularname" style="color:Red;visibility:hidden;">Please enter Character only!</span>
<label>Email <font class="man_txt">*</font></label>
<input name="txtEmail" type="text" id="txtEmail" class="textbox" />
<span id="reqEmail" style="color:Red;visibility:hidden;">Please enter your Email!</span>
<span id="regulemail" style="color:Red;visibility:hidden;">Please enter your Email!</span>
<label>Phone <font class="man_txt">*</font></label>
<input name="txtphone" type="text" maxlength="15" id="txtphone" class="textbox" />
<span id="reqphone" style="color:Red;visibility:hidden;">Please enter your PhoneNo!</span>
<span id="rexNumber" style="color:Red;visibility:hidden;">Please enter numbers only!</span>
<label>Enquiry Message <font class="man_txt">*</font></label>
<textarea name="txtmsg" rows="2" cols="20" id="txtmsg" class="textbox">
</textarea>
<span id="reqMsg" style="color:Red;visibility:hidden;">Please enter your Enquire Message!</span>
<p>
<input type="submit" name="btnSubmit" value="Submit" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("btnSubmit", "", true, "", "", false, false))" id="btnSubmit" class="btn" />
<input type="reset" class="btn" value="Reset" name="reset"/></p>
</div>
<script type="text/javascript">
//<![CDATA[
var Page_Validators = new Array(document.getElementById("reqName"), document.getElementById("regularname"), document.getElementById("reqEmail"), document.getElementById("regulemail"), document.getElementById("reqphone"), document.getElementById("rexNumber"), document.getElementById("reqMsg"));
//]]>
</script>
<script type="text/javascript">
//<![CDATA[
var reqName = document.all ? document.all["reqName"] : document.getElementById("reqName");
reqName.controltovalidate = "txtname";
reqName.errormessage = "Please enter your name!";
reqName.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
reqName.initialvalue = "";
var regularname = document.all ? document.all["regularname"] : document.getElementById("regularname");
regularname.controltovalidate = "txtname";
regularname.errormessage = "Please enter Character only!";
regularname.evaluationfunction = "RegularExpressionValidatorEvaluateIsValid";
regularname.validationexpression = "^[a-zA-Z\'.\\s]{1,40}$";
var reqEmail = document.all ? document.all["reqEmail"] : document.getElementById("reqEmail");
reqEmail.controltovalidate = "txtEmail";
reqEmail.errormessage = "Please enter your Email!";
reqEmail.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
reqEmail.initialvalue = "";
var regulemail = document.all ? document.all["regulemail"] : document.getElementById("regulemail");
regulemail.controltovalidate = "txtEmail";
regulemail.errormessage = "Please enter your Email!";
regulemail.evaluationfunction = "RegularExpressionValidatorEvaluateIsValid";
regulemail.validationexpression = "\\w+([-+.\']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*";
var reqphone = document.all ? document.all["reqphone"] : document.getElementById("reqphone");
reqphone.controltovalidate = "txtphone";
reqphone.errormessage = "Please enter your PhoneNo!";
reqphone.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
reqphone.initialvalue = "";
var rexNumber = document.all ? document.all["rexNumber"] : document.getElementById("rexNumber");
rexNumber.controltovalidate = "txtphone";
rexNumber.errormessage = "Please enter numbers only!";
rexNumber.evaluationfunction = "RegularExpressionValidatorEvaluateIsValid";
rexNumber.validationexpression = "^[0-9]+$";
var reqMsg = document.all ? document.all["reqMsg"] : document.getElementById("reqMsg");
reqMsg.controltovalidate = "txtmsg";
reqMsg.errormessage = "Please enter your Enquire Message!";
reqMsg.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
reqMsg.initialvalue = "";
//]]>
</script>
<script type="text/javascript">
//<![CDATA[
var Page_ValidationActive = false;
if (typeof(ValidatorOnLoad) == "function") {
ValidatorOnLoad();
}
function ValidatorOnSubmit() {
if (Page_ValidationActive) {
return ValidatorCommonOnSubmit();
}
else {
return true;
}
}
//]]>
</script>
</form>
我在这里给了我的代码。我已将此页面迁移到wordpress。单击提交按钮的验证不起作用,而是重定向到其他页面。我收到错误消息为
SyntaxError: illegal character
...ypeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false...
?p=1704 (line 166, col 45)
请有人帮我解决这个问题吗?
答案 0 :(得分:0)
将&&
替换为&&
。
您的代码在迁移过程中混乱不堪。