2014-01-08 68 views
0

我有在Chrome,Firefox,Safari和IE 9 & 8.但是IE 7大提交不提交表單在所有形式,我已經看了其他線程,但我找不到爲什麼它不適合我的答案。你可以看到完整的頁面在這裏http://go.nelson.com/myNelsonMigration.html表格在IE 7不會僅提交

我輸入的代碼已經是:

<input type="submit" value="Submit" class="btn btn-large btn-primary"> 

完整的表格代碼如下:

<meta name="viewport" content="width=device-width, initial-scale=1.0"> 
<title>myNelson Upgrade Form</title> 
<script type="text/javascript" src="http://go.nelson.com/rs/nelsoneducation/images/jquery-1.8.0.min.js"></script> 
<script type="text/javascript" src="http://go.nelson.com/rs/nelsoneducation/images/jquery_validate.min.js"></script> 
<script type="text/javascript" src="http://go.nelson.com/rs/nelsoneducation/images/SHA1.js"></script> 


<link rel="stylesheet" href="http://go.nelson.com/rs/nelsoneducation/images/bootstrap.min.css" media="all"> 
<link rel="stylesheet" href="http://go.nelson.com/rs/nelsoneducation/images/bootstrap-responsive.min.css" media="all"> 
<link rel="stylesheet" href="http://go.nelson.com/rs/nelsoneducation/images/style3.css" media="all"> 

<!-- HTML5 shim, for IE6-8 support of HTML5 elements --> 
<!--[if lt IE 9]> 
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> 
<![endif]--> 

<script type="text/javascript"> 
    function getCheckBoxValue(id){ 
     if($("#"+id+":checked").length > 0){ 
      return "1"; 
     } 
     else 
     { 
      return "false"; 
     } 
    } 
    function getGrades() 
    { 
     var grades = ""; 
     $("#grades input:checkbox:checked").each(function(){ 
       grades += $(this).parent().text()+","; 
     }); 

     return grades.substring(0, grades.length-1).substring(1); 
    } 

    function getInterests() 
    { 
     var interests = ""; 
     $("#interests input:checkbox:checked").each(function(){ 
       interests += $(this).parent().text()+","; 
     }); 
     return interests.substring(0, interests.length-1).substring(1); 
    } 

    function getNewsletters() 
    { 
     var newsletters = ""; 
     $("#newsletters input:checkbox:checked").each(function(){ 
       newsletters += $(this).parent().text()+","; 
     }); 
     return newsletters.substring(0, newsletters.length-1).substring(1).replace(/ - View Sample/g, ''); 
    } 
    $(document).ready(function(){ 
     $('#province').val(""); 


     $("#form-marketo").validate({ 
      rules: { 
       email: {email: true, required: true}, 
       namefirst: "required", 
       namelast: "required", 
       position: "required", 
            City: "required", 
       province: "required", 
       schoolboard: "required", 
            school: "required", 

      }, 
      submitHandler: function(){ 
      var lead_data = { 
       Email: $("#email").val(), 
       Title: $("#position").val(), 
       State: $("#province").val(), 
            City: $("#city").val(), 
       SchoolBoard: $("#school-board").val(), 
            School: $("#school").val(), 
       Preference_Center_Interests : getInterests(), 
       Preference_Center_Newsletters: getNewsletters() 
      }; 
      lead_data["FirstName"] = $("#name-first").val(); 
      lead_data["LastName"] = $("#name-last").val(); 



      mktoMunchkinFunction('associateLead', lead_data, SHA1("NelsonEdu2013"+$("#email").val())); 
      //sub form submit redirect 
      setTimeout("location.href='http://go.nelson.com/myNelsonUpgrade_Confirm.html';",3000); 
      return false; 
      } 
     }); 
    }); 
</script> 
<style> 
    Label.error { 
     color: red; 
    } 
</style> 

<div class="container"> 
    <div class="row"> 
     <div class="span12"> 
      <a href="http://nelson.com/" class="header-logo"></a> 
     </div> 
    </div> 


    <div class="row"> 
     <div class="span12"> 
      <form action="" method="post" id="form-marketo"> 
       <div class="row"> 
        <div class="span4"> 
         <div class="step1"> 
          <h2 style="line-height: 40px; color: #3B4953; size: 40px; text-align: center;">Fill in your information</h2> 

          <label for="email">Email</label> 
          <input type="email" name="email" id="email" class="input-block-level"> 

          <label for="name-first">First name</label> 
          <input type="text" name="namefirst" id="name-first" class="input-block-level"> 

          <label for="name-last">Last name</label> 
          <input type="text" name="namelast" id="name-last" class="input-block-level"> 

          <label for="position">Position</label> 
          <select name="position" id="position" class="input-block-level"> 
           <option value="">Select a Position</option> 
           <option value="Administrative Staff">Administrative Staff</option> 
           <option value="Consultant">Consultant</option> 
           <option value="Department head">Department head</option> 
           <option value="Director">Director</option> 
           <option value="Homeschooler">Homeschooler</option> 
           <option value="Lead Teacher">Lead Teacher</option> 
           <option value="Librarian">Librarian</option> 
           <option value="Principal">Principal</option> 
           <option value="School Purchasing Agent">School Purchasing Agent</option> 
           <option value="Student Teacher">Student Teacher</option> 
           <option value="Supply Teacher">Supply Teacher</option> 
           <option value="Superintendent">Superintendent</option> 
           <option value="Teacher">Teacher</option> 
           <option value="Teaching Assistant">Teaching Assistant</option> 
           <option value="Technology Specialist">Technology Specialist</option> 
           <option value="Vice principal">Vice principal</option> 
           <option value="Other">Other</option> 
          </select> 

          <label for="city">City</label> 
          <input type="text" name="city" id="city" class="input-block-level"> 

          <label for="province">Province</label> 
          <select name="province" id="province" class="input-block-level"> 
           <option value="">Select a Province</option> 
           <option value="AB">Alberta</option> 
           <option value="BC">British Columbia</option> 
           <option value="MB">Manitoba</option> 
           <option value="NB">New Brunswick</option> 
           <option value="NL">Newfoundland and Labrador</option> 
           <option value="NS">Nova Scotia</option> 
                    <option value="NU">Nunavut</option> 
           <option value="NT">Northwest Territories</option> 
           <option value="ON">Ontario</option> 
           <option value="PE">Prince Edward Island</option> 
           <option value="QC">Quebec</option> 
           <option value="SK">Saskatchewan</option> 
           <option value="YT">Yukon</option> 
          </select> 

          <label for="school-board">School Board</label> 
          <select name="schoolboard" id="school-board" class="input-block-level"> 
           <option value="">Select a School Board</option> 
          </select> 

          <label for="school">School</label> 
          <select name="school" id="school" class="input-block-level"> 
           <option value="">Select a School</option> 
          </select> 

      <p align="center" style="margin-top:1em; font-size:25px"> 
        <input type="submit" value="Submit" class="btn btn-large btn-primary"> 
       </p> 
         </div> 
        </div> 

         </div> 


          </div> 






      </form> 
     </div> <!-- /span12 --> 
    </div> <!-- /row --> 
</div> 

<script src="http://go.nelson.com/rs/nelsoneducation/images/bootstrap.min.js"></script> 
<script src="http://go.nelson.com/rs/nelsoneducation/images/dropdown1.js"></script> 
<script src="http://go.nelson.com/rs/nelsoneducation/images/scrollToElement.js"></script> 

<script> 
    $(document).ready(function($) { 
     var width = $(window).width(); // Get window width 
     if (width <= 480) { 
      $('.btn').addClass('btn-small'); 
     } 

     // Radio/Checkbox label tap fix for iOS devices 
     if (navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/iPad/i)) { 
      $('label[for]').click(function() { 
       var el = $(this).attr('for'); 
       if ($('#' + el + '[type=radio], #' + el + '[type=checkbox]').attr('selected', !$('#' + el).attr('selected'))) { 
        return; 
       } else { 
        $('#' + el)[0].focus(); 
       } 
      }); 
     } 
    }); 
</script> 
+1

'學校:「需要」,'後面的逗號這裏可能會導致問題 – scrappedcola

+0

@scrappedcola問題解決了!非常感謝一位謙虛的非開發人員:)! – ilostar

回答

1

school: "required",尾隨這裏的逗號可能會導致問題

+2

OP表示這確定了這個問題...不會被認爲是'問題的答案'嗎? – showdev