簡體   English   中英

為什么我的表格不提交或發布

[英]Why is my form not submitting or posting

表單不使用connector.php提交或發布到數據庫。 我嘗試刪除驗證無濟於事,我不知道出了什么問題。 這個問題困擾了我一兩天。 請幫助人們。

`

<title>Sign up</title>
<link href="css/alldatcookies.css" rel="stylesheet" type="text/css" />
</head>

<body>
<nav class="nav ssm-nav-visible">
        <img src="img/swipe.png" alt="swipe image" width="73" height="85" align="right" />
        <p><img src="seventhswellicon10.png" width="178" height="169" align="middle" /></p>

           <ul>
<li><a class="" href="">Home</a></li>
<li><a href="">Login</a></li>
<li><a href="SignUp.html">Sign Up</a></li>
<li><span style="color: #FFFFFF"></span><a href="">Contact</a></li>
</ul>
</nav>

<form id="msform" name="msform" onSubmit="return checkForm(this)"         action="connector.php" method="POST" >
<a href="#" style="color:#FFFFFF" class="ssm-open-nav" title="open nav">Menu</a>
<ul id="progressbar">
    <li class="active">Account Setup</li>
    <li> Profile</li>
    <li>Personal Details</li>
    </ul>
    <fieldset>
    <h2 class="fs-title">Create your account</h2>
    <h3 class="fs-subtitle">Step 1</h3>
        <input id="username" name="username" placeholder="In Game Username"/>
    <input id="email" name="email" placeholder="email"/>
    <br />
    <input type="password" id="pass" name="pass" placeholder="Password" pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,}"onchange="form.cpass.pattern = this.value;">
   <br />   
   <input type="password" id="cpass" name="cpass" placeholder="Confirm Password" onKeyUp="checkPass(); return false;"  pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,}"/> <br />
    <input type="button" name="next" class="next action-button" value="Next" />
    </fieldset> <fieldset><h2 class="fs-title">Social Profiles</h2>
    <h3 class="fs-subtitle">Your presence on the social network</h3>
    <input type="text" name="twitter" placeholder="Twitter" />
    <input type="text" name="facebook" placeholder="Facebook" />
    <input type="text" name="gplus" placeholder="Google Plus" />
    <input type="button" name="previous" class="previous action-button" value="Previous" />   <input type="button" name="next" class="next action-button" value="Next" />   </fieldset>
    <fieldset>
    <h2 class="fs-title">Personal Details    </h2>
     <input type="text" id="firstname" name="firstname" placeholder="First Name" value="" /><br />
      <br />
    <input type="text" id="lastname" name="lastname" placeholder="Last Name" />
     <br />
     <input type="tel" id="phone" name="phone" placeholder="Phone" />
     <br />
     </textarea> 
      <input type="button" name="previous" class="previous action-button" value="Previous" />
      <input type="submit" name="submit" id="msform"class="submit action-button" value="Submit"/>
      </fieldset>
      </form>
      <script language="javascript">function validateForm()
      {
      var x=document.forms["msform"]["firstname"].value;
      if (x==null || x=="")
      {
      writeError("First name must be filled out");
      return false;  }
      return true
      }
      function validateForm()
      {
      var x=document.forms["msform"]["lastname"].value;
      if (x==null || x=="")
      {
      writeError("Last name must be filled out");
      return false;
      }
      return true
      }
      function validateForm() 
      {re = /[1-10]/;
      var x=document.forms["msform"]["phone"].value;
      if (x==null || x=="")
      {
      writeError("Phone number must be filled out");
      return false;
      }
      else
      {
      if(!re.test(document.forms["msform"]["phone"].value)) {
       writeError("Phone must at least contain 10 numbers ex. 1234567890!");
      document.forms["msform"]["phone"].focus();
      return false;
      }
      return true
      }
      }
      function validateForm()
      {
      var x=document.forms["msform"]["username"].value;
      if (x==null || x=="")
      {
      writeError("Username must be filled out");
       return false;
       }
       re = /^\w+$/;
       if(!re.test(document.forms["msform"]["username"].value)) {
       $(this).w2tag.alert("Username must contain only letters, numbers and     underscores!");
       document.forms["msform"]["username"].focus();
       return false;
       }
       return true
       }
       function validateForm()
       {
       var x=document.forms["msform"]["email"].value;
       var atpos=x.indexOf("@");
       var dotpos=x.lastIndexOf(".");
       if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
       {
        writeError("Not a valid e-mail address");

          return false;
        }
        return true

        }

        function checkPass()

        {

        //Store the password field objects into variables ...

        var pass1 = document.getElementById('pass');

        var pass2 = document.getElementById('cpass');

        //Store the Confimation Message Object ...

        var message = document.getElementById('confirmMessage');

        //Set the colors we will be using ...

        var goodColor = "#66cc66";

        var badColor = "#ff6666";

        //Compare the values in the password field 

        //and the confirmation field

        if(pass1.value == pass2.value){

        //The passwords match. 

        //Set the color to the good color and inform

        //the user that they have entered the correct password 

        pass2.style.backgroundColor = goodColor;

        message.style.color = goodColor;

        message.w2tag = "Passwords Match!";

        }else{

        return false

        {

        //The passwords do not match.

       //Set the color to the bad color and

 //notify the user.

        pass2.style.backgroundColor = badColor;

        message.style.color = badColor;

        message.w2tag = "Passwords Do Not Match!";

        }

        return true

        } 

        }

        </script> 

        <style type="text/css">

        {}options: {

        css    : {,    ;// css rules for input

        class  : '',    ;// class name for input

        onShow : null,  ;// function to execute when overlay is shown 

        onHide : null   ;// function to execute when overlay is hidden 

        }

        </style>

        <!-- jQuery -->


     <script src="Javascript/jquery-2.1.0.min.js" type="text/javascript">                     </script>


        <!-- jQuery easing plugin -->
        <script src="Javascript/jquery.easing.min.js" type="text/javascript"></script>

        <script src="css/cookiemonster.js" type="text/javascript"></script>                 

     <script 

             src="http://labs.rampinteractive.co.uk/touchSwipe/jquery.touchSwipe.min.js">  

   </script>

    <script src="jquery.slideandswipe.min.js"></script>

    <div class="ssm-overlay"></div>


    <script>

       $(document).ready(function() {

            $('.nav').slideAndSwipe();

     });

         </script>



      </body>

      </html>`

腳本中似乎沒有激活它的任何內容。 通常,您希望腳本以單擊或類似的方式開始……您的代碼似乎沒有任何事件可觸發功能。

看一下這個站點 ,該站點演示了如何使用.addEvent啟用提交按鈕。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM