Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/67.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我使用JavaScript验证验证验证码无效 函数validate2(id) { var regex=[a-z]; var ctrl=document.getElemetnById(id); if(正则表达式测试(控制值)){ 返回true; } 否则{_Javascript - Fatal编程技术网

我使用JavaScript验证验证验证码无效 函数validate2(id) { var regex=[a-z]; var ctrl=document.getElemetnById(id); if(正则表达式测试(控制值)){ 返回true; } 否则{

我使用JavaScript验证验证验证码无效 函数validate2(id) { var regex=[a-z]; var ctrl=document.getElemetnById(id); if(正则表达式测试(控制值)){ 返回true; } 否则{,javascript,Javascript,我使用JavaScript验证验证验证码无效 函数validate2(id) { var regex=[a-z]; var ctrl=document.getElemetnById(id); if(正则表达式测试(控制值)){ 返回true; } 否则{ 返回false; } } 函数TestCompanyName(txtCompanyName){ var obj=document.getElementById(txtCompanyName); var RegEx=/该死的正则表达式/ 如果(

我使用JavaScript验证验证验证码无效

函数validate2(id)
{
var regex=[a-z];
var ctrl=document.getElemetnById(id);
if(正则表达式测试(控制值)){
返回true;
}
否则{
返回false;
}
}
函数TestCompanyName(txtCompanyName){
var obj=document.getElementById(txtCompanyName);
var RegEx=/该死的正则表达式/
如果(正则表达式测试(对象值)=假)
{
警报(“无效”);
}
}
函数检查名称(输入1)
{
变量模式=/^([a-zA-Z0-9_。-])+@([a-zA-Z0-9_。-])+\([a-zA-Z])+([a-zA-Z])+([a-zA-Z])+/;
返回模式测试(输入1);
}
如果(!isvalid){
警报(“无效名称”);
document.getElementById(“input1”).value=“”;
}
}
功能电话号码(电话号码){
var phoneno=/^\+?([0-9]{2})\)?[-.]?([0-9]{4})[-.]?([0-9]{4})$/;
if(telno.value.match(phoneno))
{
返回true;
}  
否则{
警报(“信息”);
返回false;
}
}
功能电话号码2(mobileno){
变量phoneno1=/^\+?([0-9]{2})\)?[-.]?([0-9]{4})[-.]?([0-9]{4})$/;
if(mobileno.value.match(phoneno1))
{
返回true;
}  
否则{
警报(“信息”);
返回false;
}
}
函数验证(){
var ta=document.getElementById(“ta”).value;
var answer=document.getElementbyId(“answer”).value;
var digit1=parseInt(document.getElementById(“digit1”).innerHTML);
var digit2=parseInt(document.getElementById(“digit2”).innerHTML);
var sum=digit1+digit2;
如果(答案==null | |答案==“”){
警报(“请添加号码”);
返回false;
}否则如果(回答!=总和){
警惕(“你的数学错了”);
}else if(ta==null | | ta==“”){
提醒(“请填写文本区域”);
}否则{
document.getElementById(“status”).innerHTML=“处理”;
document.getElementById(“答案”).innerHTML=“”;
}
}
函数randomNums(){
var rand_num1=数学地板(数学随机()*10)+1;
var rand_num2=数学地板(数学随机()*10)+1;
document.getElementById(“digit1”).innerHTML=rand_num1;
document.getElementById(“digit2”).innerHTML=rand_num2;
}
纸牌报价
填写报价表
塑料涂层纸:
选择纸张
黑心330
黑心320
黑心315
黑心305
黑心300
黑心280
白心330
白色中心320
白心315
白色中心305
白色中心300
白色中心280


或 100%纯塑料: 您的联系信息: *名字 *姓 *电子邮件Id (请键入正确的电子邮件地址,因为报价将转发到那里) *电话号码 (请勿输入空格) *手机号码 *公司名称 *地址 *邮政编码:
    <script>
    function validate2(id)
    {
        var regex = [a-z];
        var ctrl =  document.getElemetnById(id);

        if (regex.test(ctrl.value)) {
            return true;
        }
        else {
            return false;
        }
    }
    </script>

    <script>

    function TestCompanyName(txtCompanyName){

        var obj = document.getElementById(txtCompanyName);

        var RegEx = /THE DAMN REGULAR EXPRESSION/

        if(RegEx.test(obj.value)==false)

        {

            alert("Invalid");

        }

    }

    </script>
    </script>
    <script>
    function checklname(input1)
    {
        var pattern=/^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/;
        return pattern.test(input1);
    }
    if(!isvalid) {
        alert('Invalid name');
        document.getElementById("input1").value = "";
    }
    }
    </script>
    <script>
    function phonenumber(telno) {
      var phoneno = /^\+?([0-9]{2})\)?[-. ]?([0-9]{4})[-. ]?([0-9]{4})$/;
      if(telno.value.match(phoneno))
          {
        return true;
      }  
      else {  
        alert("message");
        return false;
      }
    }

    </script>

    <script>
    function phonenumber2(mobileno) {
      var phoneno1 = /^\+?([0-9]{2})\)?[-. ]?([0-9]{4})[-. ]?([0-9]{4})$/;
      if(mobileno.value.match(phoneno1))
          {
        return true;
      }  
      else {  
        alert("message");
        return false;
      }
    }

    </script>
        <script>

    function validate() {
        var ta = document.getElementById("ta").value;
        var answer  = document.getElementbyId("answer").value;
        var digit1 = parseInt(document.getElementById("digit1").innerHTML);
        var digit2 = parseInt(document.getElementById("digit2").innerHTML);
        var sum = digit1 + digit2;
        if(answer == null || answer == ""){
            alert("please add the number");
            return false;
        }else if(answer != sum){
            alert("you math is wrong");
        }else if(ta == null || ta == ""){
            alert("please fill in  the textarea");
        }else{
            document.getElementById("status").innerHTML = "processing";
            document.getElementById("answer").innerHTML = "";
        }
        }


    function randomNums(){
        var rand_num1 = Math.floor(Math.random() * 10) +1;
        var rand_num2 = Math.floor(Math.random() * 10) +1;
        document.getElementById("digit1").innerHTML = rand_num1;
            document.getElementById("digit2").innerHTML = rand_num2;
    }
    </script








    <script>
    function checkEmail(inputvalue){    
    var pattern=/^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/;
             return pattern.test(inputvalue); 
    }
    checkEmail('rte@co') // false
    checkEmail('rte@co.com') // true
    </script>
    <script>
    var address = /^[a-zA-Z0-9-\/] ?([a-zA-Z0-9-\/]|[a-zA-Z0-9-\/] )*[a-zA-Z0-9-\/]$/;
                if ( address.test($.trim($('#address').val())) == false)
                {
                     alert('invalid address ');
                }
            </script>
    <script>
    function IsValidZipCode(zipcode) {
            var isValid = /[\^$%@!#&\*:<>\?\/\\~\{\}\(\)\+|]/.test(zipcode);
            if (!isValid){
           alert('Invalid ZipCode');
          document.getElementById("zipcode").value = "";
        }


    </script>



    <script type="text/javascript" src="js/bootstrap-3.1.1.min.js"></script>
            <script type="text/javascript" src="js/jquery-1.11.1.min.js"></script>
            <?php include("include files/favicon.php"); ?>
        </head>
        <body itemscope itemtype="http://schema.org/Organization">
            <?php 
            include("include files/header.php");
            ?>
            <?php 
            include("include files/navigation.php");
            ?>
            <!--breadcrumb-->
            <div id='location'>
            <div id="BannerAndNavigatorHtmlBlock_StoreNavigator_pnNavigator" itemscope=""  itemtype="http://schema.org/BreadcrumbList" class="btn-group btn-breadcrumb">
            <span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem" class="btn btn-success">
            <a itemprop="item" href="/">
            <span class="glyphicon glyphicon-home" itemprop="name">
            </span>
            </a>
            <span itemprop="position" content="1">
            </span>
            </span>
            </span>
            <span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"class="btn btn-success">
            <span itemprop="name">Playing Card Quote</span><span itemprop="position" content="2"></span>
            </span>
            </div>
            </div>
            <!--Main Content-->
            <div class="wrapper">
            <div class="container">
            <div>&nbsp;</div>
            <div class="well">
            <form action="thank-you.php" method="post" id="form1" onsubmit="MM_validateForm('quantity','','R','fname','','R','email','','NisEmail','telno','','RisNum','address','','R','city','','R','state','','R','country','','R','zipcode','','R');return document.MM_returnValue && jcap();">
            <fieldset>
            <legend>
        <h1>Fill Quote Form</h1>
    </legend>
    <div class="quote-form">
        <div>&nbsp;</div>
        <div class="row">
            <div class="form-group">
                <label class="control-label col-sm-6">Plastic Coated Paper :</label>
                <div class="col-sm-3">
                    <select class="form-control" name="plastic_coated_paper" id="plastic_coated_paper" onchange="chgSelect('coatedpaper');">
                        <option selected value="0" id="selectpaper">Select Paper</option>
                        <option>Black Centered 330</option>
                        <option>Black Centered 320</option>
                        <option>Black Centered 315</option>
                        <option>Black Centered 305</option>
                        <option>Black Centered 300</option>
                        <option>Black Centered 280</option>
                        <option>White Centered 330</option>
                        <option>White Centered 320</option>
                        <option>White Centered 315</option>
                        <option>White Centered 305</option>
                        <option>White Centered 300</option>
                        <option>White Centered 280</option>
                    </select>
                </div>
                <div class="col-sm-3" style="text-align:center;">
                </div>
                <br>
                <br>
                          <center>OR</center>
            </div>
        </div>
        <div>&nbsp;</div>
        <div class="row">
            <div class="form-group">
                <label class="control-label col-sm-6">100% Pure Plastic : </label>
                <h2>Your Contact Information :</h2>
                <form action="" method="POST">
                <div>&nbsp;</div>
                      <div class="row">
                    <div class="form-group">
                    <label class="control-label col-sm-6"><i>*</i> First Name</label>
                    <div class="col-sm-3">
                    <div>
                   <input  name="fname" id= "id" type="text" onSubmit="" tabindex="2" required="required">
                    </div>
                    </div>
                    <div class="col-sm-3">
                    </div>
                    </div>
                    </div>
                <div>&nbsp;</div>
                <div class="row">
                <div class="form-group">
                <label class="control-label col-sm-6"><i>*</i> Last  Name</label>
                <div class="col-sm-3">
                <div>
            <label>
        <input name="lname" id="input1" type="text" tabindex="2" required="required">
                </label>
            </div>
                </div>
                <div class="col-sm-3">
                </div>
                </div>
                </div>
                <div>&nbsp;</div>
                <div class="row">
                <div class="form-group">
                <label class="control-label col-sm-6"><i>*</i> Email Id</label>
                <div class="col-sm-3">
                 <div>
                <label>
                 <input name="email" type="email" tabindex="2" required="required">
                </label>
                 </div>
                 </div> 
                </div>
                <div class="col-sm-3">
                </div>
                </div>
                </div>
                <div>&nbsp;</div>
                <div class="row">
                <div class="form-group">
                <div class="col-sm-6">
                </div>
                <div class="col-sm-5">(Please type in a correct email address , as the quotes will be forwarded there)</div>
                </div>
                </div>
                <div>&nbsp;</div>
                <div class="row">
                <div class="form-group">
                <label class="control-label col-sm-6"><i>*</i> Telephone Number</label>
                <div class="col-sm-3">
                <div>
                <label>
                <input  name="telno" id="telno" type="text" tabindex="2" required="required">
                </label>
                 </div>
                </div>
                <div class="col-sm-3">( Do not enter space)
                </div>
                </div>
                </div>
                <div>&nbsp;</div>
                <div class="row">
                <div class="form-group">
                <label class="control-label col-sm-6"><i>*</i> Mobile Number</label>
                <div class="col-sm-3">
                <div>
                <label>
               <input  name="mobileno" id="mobileno" type="text" tabindex="2" required="required">
                </label>
                 </div>
                </div>
                <div class="col-sm-3">
                </div>
                </div>
                </div>
                <div>&nbsp;</div>
                <div class="row">
                <div class="form-group">
                <label class="control-label col-sm-6">&nbsp;<i>*</i> Company Name</label>
                <div class="col-sm-3">
               <div>
                <label>
            <input type="text" name="txtCompanyName" id="txtCompanyName" required="required" onclick="TestCompanyName('txtCompanyName')">
         </label>
            </div>
            </div>
                <div class="col-sm-3">
                </div>
                </div>
                </div>
                <div>&nbsp;</div>
                <div class="row">
                <div class="form-group">
                <label class="control-label col-sm-6"><i>*</i> Address</label>
                <div class="col-sm-3">
                <input id="address" class="address" type="text"   name="address" 
                onchange="IsValidAddress(this.form.address.value)" required="required" >     
                </div>
                <div class="col-sm-3">
                </div>
                </div>
                </div>
                <div>&nbsp;</div>
                <div class="row">
                <div class="form-group">
                <label class="control-label col-sm-6"><i>*</i> Zip Code :</label>
                <div class="col-sm-3">
       <input id="zipcode" class="zipcode" type="text"  name="zipcode" onchange="IsValidZipCode(this.form.zipcode.value)" required="required" >
    <br />
                </div>
                <div class="col-sm-3">
                </div>
                </div>
                </div>
                <div>&nbsp;</div> 
                <div class="row">
                <div class="form-group">
                <label class="control-label col-sm-6"><i>*</i> City</label>
                <div class="col-sm-3">
                <input class="form-control" name="city" type="text" id="city" required="required" value="">   
                </div>
                <div class="col-sm-3">
                </div>
                </div>
                </div>
                <div>&nbsp;</div>
                <div class="row">
                <div class="form-group">
                <label class="control-label col-sm-6"><i>*</i> State</label>
                <div class="col-sm-3">
                <input class="form-control" name="state" type="text" id="state" value="" required ="required">     
                </div>
                <div class="col-sm-3">
                </div>
                </div>
                </div>
                <div>&nbsp;</div>
                <div class="row">
                <div class="form-group">
                <label class="control-label col-sm-6"><i>*</i> Country</label>
                <div class="col-sm-3">
                <input class="form-control" name="country" type="text" id="country" value="" required="required">    
                </div>
                <div class="col-sm-3">
                </div>
                </div>
                </div>
                <div>&nbsp;</div>
                <div class="row">
                <div class="form-group">
                <label class="control-label col-sm-6">&nbsp;Fax</label>
                <div class="col-sm-3">
                <input class="form-control" name="fax" type="text" id="fax" value="" required ="required">    
                </div>
                <div class="col-sm-3">
                </div>
                </div>
                </div>
                <div>&nbsp;</div>
                <div class="row">
                <div class="form-group">
                <label class="control-label col-sm-6"><i>*</i> Captcha</label>
            <div class="col-sm-2">
            </div>
            <div class="col-sm-3">
        <body>
    <form name="review" ACTION="newpg.html" METHOD="POST" onsubmit="return checkform(this);">
    <font color="#DD0000">Enter Code ></font> <span id="txtCaptchaDiv" style="background-color:#A51D22;color:#FFF;padding:5px"></span>
    <input type="hidden" id="txtCaptcha" />
    <input type="text" name="txtInput" id="txtInput" size="15" />
    <input type="submit" value="Submit"/>
    </form>

    <script type="text/javascript">
    function checkform(theform){
    var why = "";

    if(theform.txtInput.value == ""){
    why += "- Security code should not be empty.\n";
    }
    if(theform.txtInput.value != ""){
    if(ValidCaptcha(theform.txtInput.value) == false){
    why += "- Security code did not match.\n";
    }
    }
    if(why != ""){
    alert(why);
    return false;
    }
    }

    //Generates the captcha function
    var a = Math.ceil(Math.random() * 9)+ '';
    var b = Math.ceil(Math.random() * 9)+ '';
    var c = Math.ceil(Math.random() * 9)+ '';
    var d = Math.ceil(Math.random() * 9)+ '';
    var e = Math.ceil(Math.random() * 9)+ '';

    var code = a + b + c + d + e;
    document.getElementById("txtCaptcha").value = code;
    document.getElementById("txtCaptchaDiv").innerHTML = code;

    // Validate the Entered input aganist the generated security code function
    function ValidCaptcha(){
    var str1 = removeSpaces(document.getElementById('txtCaptcha').value);
    var str2 = removeSpaces(document.getElementById('txtInput').value);
    if (str1 == str2){
    return true;
    }else{
    return false;
    }
    }

    // Remove the spaces from the entered and generated code
    function removeSpaces(string){
    return string.split(' ').join('');
    }
    </script>

    </body>
    <div class="col-sm-3">
            </div>
            </div>
            <div>&nbsp;</div>
            <div class="row">
            <div class="form-group">
            <div class="col-sm-12">
            <center>
            <input type="submit" value="Submit" class="btn1" name="submit" id="send">
            </center>
            </div>
            </div>
            </div>
            <div>&nbsp;</div>
            </div>
            </fieldset>
            </form>
            </div>
            </div>
            </div>
            <!---footer---><?php include("include files/footer.php");?>
        </body>
    </html>
<label>Captcha</label>
<form name="review" ACTION="palying-cards-quote.php" METHOD="POST" onsubmit="return checkform(this);">
  <font color="#DD0000">Enter Code </font> <span id="txtCaptchaDiv" style="background-color:#A51D22;color:#FFF;padding:5px"></span>
  <input type="hidden" id="txtCaptcha" />
  <input type="text" name="txtInput" id="txtInput" size="15" />
  <input type="submit" value="Submit" />
</form>
function checkform(theform) {
  var why = "";

  if (theform.txtInput.value == "") {
    why += "- Security code should not be empty.\n";
  }
  if (theform.txtInput.value != "") {
    if (ValidCaptcha(theform.txtInput.value) == false) {
      why += "- Security code did not match.\n";
    }
  }
  if (why != "") {
    alert(why);
    return false;
  }
}

//Generates the captcha function
var a = Math.ceil(Math.random() * 9) + '';
var b = Math.ceil(Math.random() * 9) + '';
var c = Math.ceil(Math.random() * 9) + '';
var d = Math.ceil(Math.random() * 9) + '';
var e = Math.ceil(Math.random() * 9) + '';

var code = a + b + c + d + e;
document.getElementById("txtCaptcha").value = code;
document.getElementById("txtCaptchaDiv").innerHTML = code;

// Validate the Entered input aganist the generated security code function
function ValidCaptcha() {
  var str1 = removeSpaces(document.getElementById('txtCaptcha').value);
  var str2 = removeSpaces(document.getElementById('txtInput').value);
  if (str1 == str2) {
    return true;
  } else {
    return false;
  }
}

// Remove the spaces from the entered and generated code
function removeSpaces(string) {
  return string.split(' ').join('');
}