{"id":131,"date":"2020-06-02T21:45:22","date_gmt":"2020-06-02T21:45:22","guid":{"rendered":"http:\/\/bahadirmeric.net\/bahadir\/?p=131"},"modified":"2020-06-02T21:45:22","modified_gmt":"2020-06-02T21:45:22","slug":"javascript-ile-checkedboxlist-nesnesinden-secilen-degerleri-almak","status":"publish","type":"post","link":"http:\/\/bahadirmeric.net\/bahadir\/2020\/06\/02\/javascript-ile-checkedboxlist-nesnesinden-secilen-degerleri-almak\/","title":{"rendered":"JavaScript ile CheckedBoxList Nesnesinden Se\u00e7ilen De\u011ferleri Almak"},"content":{"rendered":"\n<p>Sayfada yer alan bir CheckedBox List nesnesi \u00fczerinde se\u00e7ilen de\u011ferleri JavaScript taraf\u0131nda alman\u0131z gerekebilir. Bu durumda da a\u015fa\u011f\u0131da payla\u015ft\u0131\u011f\u0131m kod i\u015finize yarayabilir.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&lt;%@ Page Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeBehind=&quot;Test.aspx.cs&quot; Inherits=&quot;CheckedListBox.Test&quot; %&gt;\n \n&lt;!DOCTYPE html PUBLIC &quot;-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN&quot; &quot;http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd&quot;&gt;\n \n&lt;html xmlns=&quot;http:\/\/www.w3.org\/1999\/xhtml&quot;&gt;\n&lt;head runat=&quot;server&quot;&gt;\n    &lt;title&gt;CheckedListBox Test&lt;\/title&gt;\n    &lt;script type=&quot;text\/javascript&quot;&gt;\n        function GetSelect() {\n            var checkList1 = document.getElementById('&lt;%= chkList1.ClientID %&gt;');\n            var checkBoxList1 = checkList1.getElementsByTagName(&quot;input&quot;);\n            var checkBoxSelectedItems1 = new Array();\n            for (var i = 0; i &lt; checkBoxList1.length; i++) {\n                if (checkBoxList1&#x5B;i].checked) {\n                    checkBoxSelectedItems1.push(checkBoxList1&#x5B;i].value);\n                }\n            }\n            var liste = checkBoxSelectedItems1;\n            alert('Se\u00e7ilenler -&gt; ' + liste);\n        }\n    &lt;\/script&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n    &lt;form id=&quot;form1&quot; runat=&quot;server&quot;&gt;\n    &lt;div&gt;\n     \n        &lt;asp:CheckBoxList ID=&quot;chkList1&quot; runat=&quot;server&quot;&gt;\n            &lt;asp:ListItem Value=&quot;1&quot;&gt;Test1&lt;\/asp:ListItem&gt;\n            &lt;asp:ListItem Value=&quot;2&quot;&gt;Deneme&lt;\/asp:ListItem&gt;\n            &lt;asp:ListItem Value=&quot;3&quot;&gt;Tttttt&lt;\/asp:ListItem&gt;\n            &lt;asp:ListItem Value=&quot;4&quot;&gt;Vvvvvv&lt;\/asp:ListItem&gt;\n            &lt;asp:ListItem Value=&quot;5&quot;&gt;Gggggg&lt;\/asp:ListItem&gt;\n        &lt;\/asp:CheckBoxList&gt;\n    &lt;br\/&gt;\n        &lt;asp:Button ID=&quot;btnTest&quot; runat=&quot;server&quot; Text=&quot;Neler se\u00e7ilmi\u015f ???&quot; OnClientClick=&quot;return GetSelect();&quot;\/&gt;\n    &lt;\/div&gt;\n    &lt;\/form&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>Sayfada yer alan bir CheckedBox List nesnesi \u00fczerinde se\u00e7ilen de\u011ferleri JavaScript taraf\u0131nda alman\u0131z gerekebilir. Bu durumda da a\u015fa\u011f\u0131da payla\u015ft\u0131\u011f\u0131m kod i\u015finize yarayabilir.<\/p>\n","protected":false},"author":1,"featured_media":12,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[12,6],"class_list":["post-131","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript","tag-javascript","tag-visual-studio"],"_links":{"self":[{"href":"http:\/\/bahadirmeric.net\/bahadir\/wp-json\/wp\/v2\/posts\/131","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bahadirmeric.net\/bahadir\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bahadirmeric.net\/bahadir\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bahadirmeric.net\/bahadir\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/bahadirmeric.net\/bahadir\/wp-json\/wp\/v2\/comments?post=131"}],"version-history":[{"count":1,"href":"http:\/\/bahadirmeric.net\/bahadir\/wp-json\/wp\/v2\/posts\/131\/revisions"}],"predecessor-version":[{"id":132,"href":"http:\/\/bahadirmeric.net\/bahadir\/wp-json\/wp\/v2\/posts\/131\/revisions\/132"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/bahadirmeric.net\/bahadir\/wp-json\/wp\/v2\/media\/12"}],"wp:attachment":[{"href":"http:\/\/bahadirmeric.net\/bahadir\/wp-json\/wp\/v2\/media?parent=131"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bahadirmeric.net\/bahadir\/wp-json\/wp\/v2\/categories?post=131"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bahadirmeric.net\/bahadir\/wp-json\/wp\/v2\/tags?post=131"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}