2016-07-24 5 views
0

오류가 발생했습니다. 유형 오류 : $ (..) 형식 유효성 검사가 함수가 아닙니다. 오류는 아래 JS 코드의 행에서 가져옵니다. 어떻게 고칠 수 있니? 무엇을 바꿔야합니까 ??? 당신의 지식을 공유하십시오 ...

<!-- js placed at the end of the document so the pages load faster --> 

<script src="assets/js/jquery.js"></script> 

<!-- validation plugin jquery --> 
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"></script> 
<script class="include" type="text/javascript" src="assets/js/jquery.dcjqaccordion.2.7.js"></script> 
<script src="assets/js/jquery.scrollTo.min.js"></script> 
<script src="assets/js/jquery.nicescroll.js" type="text/javascript"></script> 
<!--common script for all pages--> 
<script src="assets/js/common-scripts.js"></script> 
<!--script for this page--> 
<!-- Include Date Range Picker --> 
<!-- https://formden.com/blog/date-picker --> 
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.4.1/js/bootstrap-datepicker.min.js"></script> 
<!-- Time Picker --> 
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.6/moment.js"></script> 
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.15.35/js/bootstrap-datetimepicker.min.js"></script> 
<script src="//oss.maxcdn.com/bootbox/4.2.0/bootbox.min.js"></script> 
<!-- addmoreact.js --> 
<script src="assets/js/addmoreact.js"></script> 

<script src="assets/js/bootstrap.min.js"></script> 
<script> 
    $(document).ready(function() { 
     $('#userForm').formValidation(); 
     $('#userForm').on('success.form.fv', function(e) { 
      // You can inform the user that the data is updated successfully 
      // by highlighting the row or showing a message box bootbox 
      .alert('The Petitioner Details is updated'); 
     }); 
     $('#petView .editButton') .on('click', function() { 
      // Get the record's ID via attribute 
      var cino = $(this).attr('data-id'); 
      var ptyno = $(this).attr('data-email'); 
      var ptytype = $(this).attr('data-age'); 
      /* alert("cino::" + cino + "ptyno::" + ptyno + "ptytype::" + ptytype); */ 
      $.ajax({ 
       url : "editpet.jsp?cino=" + cino + "&ptyno=" + ptyno + "&ptytype=" + ptytype, 
       method : 'POST' 
      }).success(function(response) { 
       var res = jQuery.parseJSON(response); 
       // Populate the form fields with the data returned from server 
       $('#userForm').find('[name="advocateName"]').val(res.advname) 
       .end() 
       .find('[name="age"]') 
       .val(res.age) 
       .end() 
       .find('[name="barregistrationnumber"]') 
       .val(res.barreg) 
       .end() 
       .find('[name="mobile"]') 
       .val(res.mobile) 
       .end() 
       .find('[name="name"]') 
       .val(res.name) 
       .end() 
       .find('[name="relname"]') 
       .val(res.relname) 
       .end() 
       .find('[name="email"]') 
       .val(res.email) 
       .end() 
       .find('[name="ptyno"]') 
       .val(res.ptyno) 
       .end() 
       .find('[name="type"]') 
       .val(res.ptyType) 
       .end() 
       .find('[name="cino"]') 
       .val(res.cino) 
       .end() 
       .find('[name="passport"]') 
       .val(res.passport) 
       .end() 
       .find('[name="pan"]') 
       .val(res.pan) 
       .end() 
       .find('[name="fax"]') 
       .val(res.fax) 
       .end() 
       .find('[name="occupation"]') 
       .val(res.occupation) 
       .end() 
       .find('[name="country"]') 
       .val(res.country) 
       .end() 
       .find('[name="nationality"]') 
       .val(res.nationality) 
       .end() 
       .find('[name="phone"]') 
       .val(res.phone) 
       .end() 
       .find('[name="alternateaddress"]') 
       .val(res.alternateaddress) 
       .end(); 

       // Show the dialog bootbox 
       .dialog({ 
        title : 'Edit Petitioner Details', 
        message : $('#userForm'), 
        show : false, 
        onEscape:true 
        // We will show it manually later 
        /* http://stackoverflow.com/questions/29708075/how-to-confirm-a-form-submission-with-bootbox-using-jquery-ajax-and-json?rq=1 */ 
       }).on('shown.bs.modal', function() { 
        $('#userForm').show() 
        // Show the login form 
        .formValidation('resetForm'); // Reset form 
       }).on('hide.bs.modal', function(e) { 
        // Bootbox will remove the modal (including the body which contains the login form) 
        // after hiding the modal 
        // Therefor, we need to backup the form 
        $('#userForm').hide() 
        .appendTo('body'); 
       }).modal('show'); 

       /* if ($('#userForm #userformpetExtraInfo').is(':checked')) { 
         alert("Extra Pet Infor check"); 
         $("#userForm #userformextrapet").show(); 
        } else { 
         alert("Extra Pet Infor un check"); 
         $("#userForm #uuserformextrapet").hide(); 
        } */ 

      });//sucess 
     });  
</script> 

<!-- The form which is used to populate the item data -->      
<form id="userForm" method="post" class="form-horizontal" action="updatePetitionerView.do" > 
    <div class="form-group"> 
     <label class="col-xs-3 control-label">Advocate Name</label> 
     <div class="col-xs-3"> 
      <input type="text" 
        class="form-control" 
        name="advocateName" disabled="disabled" 
        data-toggle="tooltip" 
        data-placement="top" 
        id="advocateName" 
        title="Enter Advocate Name" 
        data-fv-notempty="true" 
        data-fv-notempty-message="The username is required" 
        data-fv-stringlength="true" 
        data-fv-stringlength-min="6" 
        data-fv-stringlength-max="30" 
        data-fv-stringlength-message="The username must be more than 6 and less than 30 characters long" 
        data-fv-regexp="true" 
        data-fv-regexp-regexp="^[a-zA-Z0-9_\.]+$" 
        data-fv-regexp-message="The username can only consist of alphabetical, number, dot and underscore" /> 
     </div> 
    </div> 
</form> 

답변

1

업데이트 대답 : 당신은 그 아래에 말한

당신은 실제로 (당신이 그것을 포함 한 이유에 대한 질문을 구걸) http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js를 사용하려고하지 않을 대신에 http://formvalidation.io/download/을 사용하려고합니다. 그러나 두 번째 플러그인을 포함 할 스크립트를 찾을 수 없다고 말한 적이 있습니다.

플러그인은 마술처럼 페이지에 자신을 추가 할 수 없습니다. 플러그인을 지불했습니다. 유효한 평가판 라이센스를 보유하고 있다면 사용해야하는 스크립트를 어디에서 다운로드해야하는지 알려줍니다. 플러그인 스크립트를 포함하지 않으면 플러그인이 사이트에서 작동하지 않습니다. 질문에 포함 된 무엇에 기초


원래 답 :

문자열 "formvalidation는"http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js 어디서나 나타나지 않습니다. 그건 분명히 당신이 그것을 사용하는 방법이 아닙니다.

the documentation의 가장 단순한 모습은 .formValidation()이 아니라 .validate()을 원한다고 제안합니다.

+0

나는 jquery.validate.min.js 내가 jquery.validate.min.js 대본이이 이 를 참조하십시오 형태 http://formvalidation.io를 확인하려고했다 제거한 bootstrap.js와 충돌 할 수 있다고 생각/download/in Declarative tab –

+0

@AjayTakur : 부트 스트랩에 추가 된 * 것이고 부트 스트랩 자체는 아닙니다. 귀하의 예제에서 그것을로드 어떤 스크립트 태그를 볼 수 없습니다. –

+0

애드온 용 스크립트 태그를 찾지 못했습니다. 시험 사용을 시도했지만 작동하지 않습니다. –