2017-01-15 11 views
0

私は、チェックボックスで複数選択ドロップダウン/リストボックスの日付時刻ピッカーjQueryの機能が正しく

<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> 
<link rel="stylesheet" href="/resources/demos/style.css"> 
<script src="https://code.jquery.com/jquery-1.12.4.js"></script> 
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> 


<script type="text/javascript"> 
    $(document).ready(function() {   
     $("#txtDate").datepicker(); 
    }); 
</script> 

、別のための2つのjQueryの機能の1つを持っています。

として
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> 
<link href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.3/css/bootstrap.min.css" 
    rel="stylesheet" type="text/css" /> 
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.3/js/bootstrap.min.js"></script> 
<link href="http://cdn.rawgit.com/davidstutz/bootstrap-multiselect/master/dist/css/bootstrap-multiselect.css" 
    rel="stylesheet" type="text/css" /> 
<script src="http://cdn.rawgit.com/davidstutz/bootstrap-multiselect/master/dist/js/bootstrap-multiselect.js"</script> 

<script type="text/javascript"> 
    $(document).ready(function() { 
     $('[id*=lstFruits]').multiselect({ 
      includeSelectAllOption: true 
     }); 
    }); 

そしてASPコード:ドロップダウン

<asp:ListBox ID="lstFruits" runat="server" SelectionMode="Multiple"> 
    <asp:ListItem Text="Mango" Value="1" /> 
    <asp:ListItem Text="Apple" Value="2" /> 
    <asp:ListItem Text="Banana" Value="3" /> 
    <asp:ListItem Text="Guava" Value="4" /> 
    <asp:ListItem Text="Orange" Value="5" /> 
</asp:ListBox> 

の日付時刻の

<asp:TextBox ID="txtDate" runat="server" ></asp:TextBox> 

私が午前の問題は、それらの両方がいないということです私のコードに日付を設定するだけで、ピッカーが動作し、マルチ選択ドロップダウンやマルチ選択ドロップダウンではなく、対応する日付時刻ピッカーコードをコメントアウトするときにのみ機能します。

私は理解できないいくつかの機能不全があります。

+0

を見つけてくださいましたか?表示されている 'multiselect'のscriptタグには'> 'がありません。質問コード – charlietfl

+0

の構文ハイライトの問題を見ることができますまた、jQuery.jsを複数回含むこともあります。 – charlietfl

+0

ええ、私は、含まれているjQuery.jsファイルにいくつかの崩壊があったと思います。以下のコードはうまく働いています... –

答えて

0

これはあなたのページで参照しているファイルを元にした実例です。これは、ASPXではなくHTMLベースなので、使いやすくなります。

注: - あなたは、私はそれらの1

<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> 
<script src="https://code.jquery.com/jquery-1.12.4.js"></script> 
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> 

<!--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>!--> 
<link href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> 
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.3/js/bootstrap.min.js"></script> 
<link href="http://cdn.rawgit.com/davidstutz/bootstrap-multiselect/master/dist/css/bootstrap-multiselect.css" rel="stylesheet" type="text/css" /> 
<script src="http://cdn.rawgit.com/davidstutz/bootstrap-multiselect/master/dist/js/bootstrap-multiselect.js"> 
</script> 
<script type="text/javascript"> 
    $(document).ready(function() { 
    $("#txtDate").datepicker(); 
    $('[id*=lstFruits]').multiselect({ 
     includeSelectAllOption: true 
    }); 
    }); 
</script> 

コメント2つのjqueryのバージョンを参照する完全なサンプルのエラーは、ブラウザのコンソールにスローされますどのようなhere

+0

魅力のような働きが素晴らしい@Mohammed Elshennawy .... –

+0

いつでも歓迎してください。@Rahulとして回答してください。 –

+0

答えとしてマークしてください。 –

関連する問題