2012-03-01 34 views
0

jqueryを使用しています。私は私のページにあるドロップダウンリストとチェックボックスを非表示にして表示しようとしています。私は正常に隠すことができますが、私は何も起こらないか、私はこのように私のコードのエラーを取得表示するようにしようとすると:私はすべての成功なしにショーの貴様のフォームを使用してみましたjqueryを使用してドロップダウンリストを表示/非表示にする方法

http://imageshack.us/photo/my-images/811/sinttuloxs.jpg/

を。

$("#ddListaPrecios").Show(); 

または

$('#ddListaPrecios').Show('slow'); 

 $(document).ready(function() { 
      $("#ddListaPrecios").hide(); 

      $("#codigoCliente").autocomplete({ 
       minLength: 1, 
       source: getData, 
       select: function(event, ui) { 
        cambiaElementos(ui.item.value); 
        updateCiudades(ui.item.value); 
        updateListaVendedores(ui.item.value); 
        updateListaPrecios(ui.item.value); 
       } 
      }); 

      $("#codigoCliente").change(function() { 

       if ($("#codigoCliente").val().length == 6) { 
        cambiaElementos($("#codigoCliente").val()); 
        updateCiudades($("#codigoCliente").val()); 
        updateListaVendedores($("#codigoCliente").val()); 
        updateListaPrecios($("#codigoCliente").val()); 

        $("#ddListaPrecios").show(); 

       } 
      }); 

      $("#ddListaPrecios").change(function() { 
       //window.alert($("#ddListaPrecios").val()); 
       changePrecio($("#ddListaPrecios").val()); 

      }); 

      $("#ddCiudad").change(function() { 
       updatePuntosEntrega($("#codigoCliente").val(), $("#ddCiudad").val()); 

      }); 
     }); 



     <label>Lista de Precios: </label> 
     <label id="lbListaPrecios"> </label> 
     <%= Html.DropDownList("ddListaPrecios") %> 
     <!-- <%= Html.CheckBox("cbCambioLista") %> <label class="inline" for="cbCambioLista">Desea cambiar lista de precios?</label> --> 
+0

jのドキュメントを参照してくださいavascriptは大文字と小文字を区別し、jquery.Showは存在しません – jbabey

+0

私のブログhttp://blogs.msdn.com/b/rickandy/archive/2012/01/09/cascasding-dropdownlist-in-asp-net-mvc.aspxこの。関連項目My DDLチュートリアルを参照してください。http://www.asp.net/mvc/tutorials/javascript/working-with-the-dropdownlist-box-and-jquery/using-the-dropdownlist-helper-with-aspnet-mvc – RickAndMSFT

答えて

0

この$("#ddListaPrecios").show();

のようにすべて小文字にする必要がある$("#ddListaPrecios").Show(); jQueryのへのあなたの呼び出しは、ここにhttp://api.jquery.com/show/

+0

まだ動作しません –

+0

@AlejandroHinestrosaこれはあなたのスクリーンショットのエラーの原因であったため、別のエラーが発生するはずです。 – Henesnarfel

+0

私はちょうど.show()に変更しても何も起こりませんが、何もエラーメッセージが表示されません。 –

関連する問題