Ver Mensaje Individual
  #6 (permalink)  
Antiguo 17/12/2014, 13:14
mblascog
 
Fecha de Ingreso: enero-2002
Ubicación: Sabadell
Mensajes: 565
Antigüedad: 22 años, 3 meses
Puntos: 4
Respuesta: El objeto no acepta la propiedad o el método 'validate'

Buenas, pues sí muy raro y seguro que algo hago mal, pero no sé verlo.

Todo mi código jquery es este:

Código Javascript:
Ver original
  1. <script>
  2.     jQuery.fn.reset = function () { // limpi
  3.         $(this).each (function() { this.reset(); });
  4.     }  
  5.     var lang = "-" + "<?php echo $idioma; ?>";
  6.     var seleccionar = "<php echo $seleccionar[$idioma]; ?>";
  7.     var opcio = "<?php echo $opcioId; ?>";
  8.  
  9.     $(document).ready(function(){
  10.         $("#divVenda").show();
  11.         $("#divTipus").show();
  12.         $("#divCaractaristiques").show();
  13.         $("#divCiutat").show();
  14.         $("#divPreu").show();
  15.         $("#divHabitacions").show();
  16.         $("#divMetres").show();
  17.    
  18.         if ((opcio == 5) || (opcio == 7) || (opcio == 9)) { // solars, locals, immobles singulars
  19.             $("#divTipus").hide();
  20.             $("#divHabitacions").hide();
  21.         }          
  22.            
  23.         if ((opcio == 6) || (opcio == 8)) { // naus i parquings
  24.             $("#divTipus").hide();
  25.             $("#divCaractaristiques").hide();
  26.             $("#divHabitacions").hide();
  27.             if (opcio == 8) { // parquings
  28.                 $("#divPreu").hide();
  29.                 $("#divMetres").hide();
  30.             }          
  31.         }
  32.  
  33.         var actFam = $("#fTipus").val();
  34.         var jIdCar  = '-' + $("#fCaracteristiques").val();
  35.         var jIdCiu  = '-' + $("#fCiutat").val();
  36.         var jIdOpe  = '-' + $("#fOperacio").val();
  37.         var selOper = '-' + $("#fOperacio").val();
  38.         var selTip  = '-' + seleccionar;
  39.  
  40.    
  41.  
  42.         // fOperacio: venda o lloguer
  43.         $("#fOperacio").change(function(){//alert('venda/lloguer: *' + selTip + '*' + jIdCar);
  44.             var actFam = $("#fTipus").val();
  45.             var jIdOpe = '-'+$("#fOperacio").val();
  46.             var selOper = '-'+$(this).val();
  47.             var selTip = '-'+$("#fCaracteristiques").val();        
  48.  
  49.             if ((opcio == 5) || (opcio == 7) || (opcio == 9)) { // solars, locals, immobles singulars
  50.                 $.post("<?php echo URL.'includes/inc_caracteristiques.php'?>",{ prmCaracteristiques:opcio + lang + jIdCar },function(data){$("#fCaracteristiques").html(data);})
  51.                 $.post("<?php echo URL.'includes/inc_preu.php'?>",{ prmPreu:opcio+lang+selOper },function(data){$("#fPreu").html(data);})
  52.             }
  53.             else {
  54.                 if ((opcio == 6) || (opcio == 8)) {// naus industrials i parquings
  55.                     $.post("<?php echo URL.'includes/inc_poblacions.php'?>",{ prmPoblacions:opcio+selOper+'-'+opcio+lang+jIdCiu },function(data){$("#fCiutat").html(data);})
  56.                     $.post("<?php echo URL.'includes/inc_preu.php'?>",{ prmPreu:opcio+lang+selOper },function(data){$("#fPreu").html(data);})
  57.                 }
  58.             }          
  59.                
  60.             var txt = $('#fOperacio option:selected').text(); <?php // obtener texto de form operacion ?>
  61.             $('input[name=ftxtOperacio]').val(txt); <?php // asignar texto de form operacion a ftxtOperacion ?>
  62.         });
  63.        
  64.         // fTipus: pis, casa, solar, nau, local comercial, parking, immoble singular
  65.         $("#fTipus").change(function(){// alert('tipus1: ' + $(this).val());
  66.             var jIdOpe = '-'+$("#fOperacio").val();
  67.            
  68.             var selOper = '-'+$("#fOperacio").val();
  69.             var selTip = '-' + seleccionar;
  70.            
  71.             $.post("<?php echo URL.'includes/inc_caracteristiques.php'?>",{ prmCaracteristiques:$(this).val()+lang+jIdCar},function(data){$("#fCaracteristiques").html(data);})
  72.             $.post("<?php echo URL.'includes/inc_poblacions.php'?>",{ prmPoblacions:$(this).val()+selOper+selTip+lang+jIdCiu },function(data){$("#fCiutat").html(data);})  
  73.             $.post("<?php echo URL.'includes/inc_preu.php'?>",{ prmPreu:$(this).val()+lang+jIdOpe },function(data){$("#fPreu").html(data);})
  74.             $.post("<?php echo URL.'includes/inc_habitacions.php'?>",{ prmHabitacions:$(this).val()+lang },function(data){$("#fHabitacions").html(data);})
  75.             $.post("<?php echo URL.'includes/inc_metres.php'?>",{ prmMetres:$(this).val()+lang },function(data){$("#fMetres").html(data);})
  76.             var txt = $('#fOperacio option:selected').text(); <?php // obtener texto de form operacion ?>
  77.             $('input[name=ftxtOperacio]').val(txt); <?php // asignar texto de form operacion a ftxtOperacion ?>
  78.         });
  79.  
  80.  
  81.         // fCaracteristiques: pis: pis, duplex, triplex, àtic, loft, planta baixa --- casa: casa, casa en construcció, casa torre aïllada
  82.         $("#fCaracteristiques").change(function(){ //alert("eooo");
  83.             if ((typeof $("#fTipus").val() == 'undefined') || (typeof $("#fTipus").val() == '')) // quan Pisos i Cases es demana tipus, en les altres opcions és a pinyó fix
  84.                 var jIdTip = opcio;
  85.             else  
  86.                 var jIdTip = $("#fTipus").val();
  87.                
  88.             var jIdOpe = '-'+$("#fOperacio").val();
  89.  
  90.             if ($(this).val() != seleccionar) {
  91.                 var selOper = '-' + $("#fOperacio").val();
  92.                 var selTip = '-' + $(this).val();
  93.  
  94.        
  95.                 if (opcio == 3) // pisos i cases
  96.                     $.post("<?php echo URL.'includes/inc_poblacions.php'?>",{ prmPoblacions:jIdTip+selOper+selTip+lang+jIdCiu },function(data){$("#fCiutat").html(data);})
  97.                 else
  98.                     $.post("<?php echo URL.'includes/inc_poblacions.php'?>",{ prmPoblacions:opcio + selOper + selTip + lang + jIdCiu },function(data){$("#fCiutat").html(data);})
  99.                
  100.                 var txt = $('#fOperacio option:selected').text(); <?php // obtener texto de form operacion ?>
  101.                 $('input[name=ftxtOperacio]').val(txt); <?php // asignar texto de form operacion a ftxtOperacion ?>
  102.             }; 
  103.         });
  104.        
  105.         $('form').submit(function() {
  106.             var txt = $('#fOperacio option:selected').text(); <?php // obtener texto de form operacion ?>
  107.             $('input[name=ftxtOperacio]').val(txt); <?php // asignar texto de form operacion a ftxtOperacion ?>        
  108.         });      
  109.  
  110.        
  111.         $("#frmRecerca").validate({
  112.             rules: {
  113.                 fOperacio: "required",
  114.                 fTipus: { required: function() {return opcio==3}}
  115.             },
  116.             messages: {
  117.                 fOperacio: "<?php echo $strMsgRequireOperation[$idioma]?>",
  118.                 fTipus: "<?php echo $strMsgRequireFamily[$idioma]?>"
  119.             }
  120.         });        
  121.  
  122.         $("#butoPasse").click(function() {
  123.             var referencia = $("#referenciaInput").val();
  124.             pagina = "<?php echo URL.'referencia/'?>" + "<?php echo $opcio?>" + "/" + referencia + "/" + "<?php echo $idioma?>" + ".html";
  125.             window.open(pagina, target="_top");
  126.         });
  127.        
  128.         $(".wowFoto").click(function() {
  129.             pagina = "<?php echo URL.'fotos/'?>" + $("#opcio").val() + "/" + $("#referenciaInput").val() + ".html";
  130.             window.open(pagina, target="_top");
  131.         });
  132.  
  133.          
  134.         $("#lupaRecerca").click(function() {
  135.             pagina = "<?php echo URL.'referencia/'?>" + "<?php echo $opcio?>" + "/" + $("#referencia").val() + "/" + "<?php echo $idioma?>" + ".html";
  136.             window.open(pagina, target="_top");
  137.  
  138.         });
  139.        
  140.         $("#lupa").click(function() {
  141.             if ($("#recerca2").css("display") == "block") {
  142.                 $("#recerca2").css("display", "none");
  143.                 $("#recerca1").css("display", "table");
  144.             }
  145.             else {
  146.                 $("#recerca2").css("display", "block");
  147.                 $("#recerca1").css("display", "none");
  148.             }
  149.         });
  150.                  
  151.         $("#inputNoRef").click(function() {
  152.             window.open("<?php echo URL.$opcio?>",target="_top");
  153.         });
  154.        
  155.         $("#butoAdministracio").click(function() {
  156.             window.open("http://www.tepui.cat?txtusuario=" + $("#usuari").val() + "&txtpassword=" + $("#contrasenya").val(), target="_blank");
  157.         });
  158.  
  159.         $("#imgMenu").click(function() {
  160.             if ($("#opcionsMenu").css("display") == "block") {
  161.                 $("#opcionsMenu").css("display", "none");
  162.                 $("article").eq(0).css("display", "block");
  163.             }
  164.             else {
  165.                 $("#opcionsMenu").css("display", "block");
  166.                 $("article").eq(0).css("display", "none");
  167.                 $("#recerca2").css("display", "none");
  168.             }
  169.         });
  170.        
  171.         $("#butoMapa").click(function() {
  172.             if ($("#mapa").css("display") == "block") {
  173.                 $("#foto").css("display", "block");
  174.                 $("#mapa").css("display", "none");
  175.             }
  176.             else {
  177.                 $("#foto").css("display", "none");
  178.                 $("#mapa").css("display", "block");
  179.             }
  180.         });
  181.  
  182.    
  183.         $(".ordre").click(function() {
  184.             var ordre = $(this).attr("data-valor");
  185.             $("#fOrdre").val(ordre);
  186.             $("#frmImmoblesTrobats").submit();
  187.         });
  188.        
  189.         $(".butoFotos").click(function() {
  190.             $('#butoFotos1').attr("class", "butoFotos");
  191.             $('#butoFotos2').attr("class", "butoFotos");
  192.             $('#butoFotos3').attr("class", "butoFotos");
  193.             $('#butoFotos4').attr("class", "butoFotos");
  194.             $('#butoFotos5').attr("class", "butoFotos");
  195.             $('#butoFotos6').attr("class", "butoFotos");
  196.             foto = $(this).attr("data-valor");
  197.             $('#fotoFincamps').attr("src", foto);
  198.             posicio = foto.indexOf('fotoFincamps');
  199.             element = foto.substring(posicio + 12,posicio + 13);
  200.             $('#butoFotos'+element).attr("class", "butoFotosActiu");
  201.         });
  202.     })
  203.        
  204.  
  205.  
  206.     // zoom img detail
  207.     var theInt = null;
  208.     var $crosslink, $navthumb;
  209.     var curclicked = 0;
  210.  
  211.     theInterval = function(cur){
  212.         clearInterval(theInt);
  213.         if( typeof cur != 'undefined' )
  214.         curclicked = cur;
  215.         $crosslink.removeClass("active-thumb");
  216.         $navthumb.eq(curclicked).parent().addClass("active-thumb");
  217.         $(".stripNav ul li a").eq(curclicked).trigger('click');
  218.         theInt = setInterval(function(){
  219.             $crosslink.removeClass("active-thumb");
  220.             $navthumb.eq(curclicked).parent().addClass("active-thumb");
  221.             $(".stripNav ul li a").eq(curclicked).trigger('click');
  222.             curclicked++;
  223.             if( 6 == curclicked )
  224.                 curclicked = 0;
  225.             }, 3000
  226.         );
  227.  
  228.     };
  229.  
  230.     $(function(){
  231.         $("#main-photo-slider").codaSlider();
  232.         $navthumb = $(".nav-thumb");
  233.         $crosslink = $(".cross-link");
  234.         $navthumb.click(function() {
  235.             var $this = $(this);
  236.             theInterval($this.parent().attr('href').slice(1) - 1);
  237.             return false;
  238.         });
  239.         theInterval();
  240.     });    
  241. </script>

Los que me dan problema són:
- $("#frmRecerca").validate({
- $("#butoPasse").click(function() {

En este link, encima de la foto, aparece una imagen con una X, al hacer click sobre de ella, debería ejecutarse el click de butoPasse
http://www.fincamps.es/fincampsMBG/f...sas/60194.html

Gracias
__________________
Qué fácil cuando lo sabes y qué difícil cuando no