{"id":10562,"date":"2015-08-29T00:17:45","date_gmt":"2015-08-29T04:17:45","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/?p=10562"},"modified":"2015-08-24T10:38:47","modified_gmt":"2015-08-24T14:38:47","slug":"getelementsbyname-an-example-checkbox","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=10562","title":{"rendered":"GetElementsByName an example: Checkbox"},"content":{"rendered":"<pre>&lt;html&gt;\r\n\r\n\u00a0\u00a0 \u00a0&lt;head&gt;\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0&lt;script type=\"text\/javascript\"&gt;\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0function getElements()\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0 {\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0 var x=document.getElementsByName(\"myInput[]\");\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0 alert(x.length);\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0 alert(x[0].value);\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0 alert(x[1].value);\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0 alert(x[2].value);\r\n\r\n\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0 }\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0&lt;\/script&gt;\r\n&lt;\/head&gt;\r\n\r\n&lt;body&gt;\r\n\u00a0\u00a0 \u00a0&lt;input name=\"myInput[]\" type=\"checkbox\" size=\"20\" value='10'\/&gt;10 \r\n\r\n\r\n\u00a0\u00a0 \u00a0&lt;input name=\"myInput[]\" type=\"checkbox\" size=\"20\" value='20' \/&gt;20\r\n\r\n\u00a0\u00a0 \u00a0&lt;input name=\"myInput[]\" type=\"checkbox\" size=\"20\" value='30' \/&gt;30<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>&lt;html&gt; \u00a0\u00a0 \u00a0&lt;head&gt; \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0&lt;script type=&#8221;text\/javascript&#8221;&gt; \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0function getElements() \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0 { \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0 var x=document.getElementsByName(&#8220;myInput[]&#8221;); \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0 alert(x.length); \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0 alert(x[0].value); \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0 alert(x[1].value); \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0 alert(x[2].value); \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0 } \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0&lt;\/script&gt; &lt;\/head&gt; &lt;body&gt; \u00a0\u00a0 \u00a0&lt;input &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=10562\">Continue reading<\/a><\/p>\n","protected":false},"author":130,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1417,1425],"tags":[706,7,1469],"class_list":["post-10562","post","type-post","status-publish","format-standard","hentry","category-code-programming-samples--","category-javascript","tag-code","tag-javascript","tag-1469","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":26495,"url":"http:\/\/bangla.sitestree.com\/?p=26495","url_meta":{"origin":10562,"position":0},"title":"GetElementsByName an example: Checkbox #Programming Code Examples #Javascript #JavaScript","author":"Author-Check- Article-or-Video","date":"April 26, 2021","format":false,"excerpt":"<html> <head> <script type=\"text\/javascript\"> function getElements() { var x=document.getElementsByName(\"myInput[]\"); alert(x.length); alert(x[0].value); alert(x[1].value); alert(x[2].value); } <\/script> <\/head> <body> <input name=\"myInput[]\" type=\"checkbox\" size=\"20\" value='10'\/>10 <input name=\"myInput[]\" type=\"checkbox\" size=\"20\" value='20' \/>20 <input name=\"myInput[]\" type=\"checkbox\" size=\"20\" value='30' \/>30 <br \/> <input type=\"button\" onclick=\"getElements()\" value=\"How many elements named 'myInput'?\" \/> <\/body> <\/html> Note: Brought from\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":65788,"url":"http:\/\/bangla.sitestree.com\/?p=65788","url_meta":{"origin":10562,"position":1},"title":"Handling Checkbox arrays with Javascript::GetElementsByName:XHTML supported #JavaScript","author":"Author-Check- Article-or-Video","date":"July 14, 2021","format":false,"excerpt":"The following code demonstrates how to handle checkboxes with JavaScript. Note the names of all c heck boxes are same myInput[]. It could also be myInput. Both works as an array to contain the controls' values. I prefer myInput[] as you can handle this control in PHP as an array.\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":70125,"url":"http:\/\/bangla.sitestree.com\/?p=70125","url_meta":{"origin":10562,"position":2},"title":"Handling Checkbox arrays with Javascript::GetElementsByName:XHTML supported #13","author":"Author-Check- Article-or-Video","date":"August 26, 2021","format":false,"excerpt":"The following code demonstrates how to handle checkboxes with javascript. Note the names of all check boxes are same myInput[]. It could also be myInput. Both works as an array to contain the controls' values. I prefer myInput[] as you can handle this control in PHP as an array. If\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":6299,"url":"http:\/\/bangla.sitestree.com\/?p=6299","url_meta":{"origin":10562,"position":3},"title":"\u09ac\u09c1\u099f\u09b8\u09cd\u099f\u09cd\u09b0\u09cd\u09af\u09be\u09aa \u09ab\u09b0\u09ae \u0987\u09a8\u09aa\u09c1\u099f (Bootstrap Form Inputs)","author":"Author-Check- Article-or-Video","date":"February 13, 2015","format":false,"excerpt":"\u09ae\u09cb: \u0986\u09b8\u09be\u09a6\u09c1\u099c\u09cd\u099c\u09be\u09ae\u09be\u09a8 \u09ae\u09bf\u09b2\u09a8 \u0986\u0987\u099f\u09bf \u0987\u09a8\u09cd\u09b8\u099f\u09cd\u09b0\u09be\u0995\u09cd\u099f\u09b0, \u098f\u09ae\u098f\u09b8\u0986\u0987\u099f\u09bf, \u0995\u09c1\u09dc\u09bf\u0997\u09cd\u09b0\u09be\u09ae\u0964 \u00a0 \u09b8\u09ae\u09b0\u09cd\u09a5\u09bf\u09a4 \u09ab\u09b0\u09ae \u0995\u09a8\u09cd\u099f\u09cd\u09b0\u09cb\u09b2 \u09ac\u09c1\u099f\u09b8\u09cd\u099f\u09cd\u09b0\u09cd\u09af\u09be\u09aa \u09a8\u09bf\u09ae\u09cd\u09a8\u09b2\u09bf\u0996\u09bf\u09a4 \u09ab\u09b0\u09cd\u09ae \u0995\u09a8\u09cd\u099f\u09cd\u09b0\u09cb\u09b2\u0997\u09c1\u09b2\u09cb \u09b8\u09ae\u09b0\u09cd\u09a5\u09a8 \u0995\u09b0\u09c7 input textarea checkbox radio select \u00a0 \u09ac\u09c1\u099f\u09b8\u09cd\u099f\u09cd\u09b0\u09cd\u09af\u09be\u09aa \u0987\u09a8\u09aa\u09c1\u099f \u09ac\u09c1\u099f\u09b8\u09cd\u099f\u09cd\u09b0\u09cd\u09af\u09be\u09aa \u098f\u0987\u099a\u099f\u09bf\u098f\u09ae\u098f\u09b2 \u09eb \u098f\u09b0 \u09b8\u0995\u09b2 \u0987\u09a8\u09aa\u09c1\u099f \u099f\u09be\u0987\u09aa, \u09af\u09c7\u09ae\u09a8 : text, password, time, color. datetime, datetime-local, date, month, week, number, email, url \u0987\u09a4\u09cd\u09af\u09be\u09a6\u09bf \u09b8\u09b0\u09cd\u09ae\u09a5\u09a8 \u0995\u09b0\u09c7\u0964 \u09a8\u09bf\u099a\u09c7\u09b0\u2026","rel":"","context":"In &quot;\u09ac\u09c1\u099f\u09b8\u09cd\u099f\u09cd\u09b0\u09cd\u09af\u09be\u09aa \u09e9 \u099f\u09bf\u0989\u099f\u09cb\u09b0\u09bf\u09df\u09be\u09b2 (Bootstrap 3 Tutorial)&quot;","block_context":{"text":"\u09ac\u09c1\u099f\u09b8\u09cd\u099f\u09cd\u09b0\u09cd\u09af\u09be\u09aa \u09e9 \u099f\u09bf\u0989\u099f\u09cb\u09b0\u09bf\u09df\u09be\u09b2 (Bootstrap 3 Tutorial)","link":"http:\/\/bangla.sitestree.com\/?cat=178"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":65784,"url":"http:\/\/bangla.sitestree.com\/?p=65784","url_meta":{"origin":10562,"position":4},"title":"Some JavaScript stuff that you need to know #JavaScript","author":"Author-Check- Article-or-Video","date":"July 14, 2021","format":false,"excerpt":"What you really need to learn in Javascript? 1. Where you can place JavaScript codes? Anywhere in the web-pages, ideally in the header section, or in an external file. If you keep javascript codes in an external file, the codes will be re-usable from different web-pages 2. Some basic programming:\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":6840,"url":"http:\/\/bangla.sitestree.com\/?p=6840","url_meta":{"origin":10562,"position":5},"title":"\u098f\u0987\u099a\u099f\u09bf\u098f\u09ae\u098f\u09b2 \u0987\u09a8\u09aa\u09c1\u099f \u09a7\u09b0\u09a8 (HTML Input Types)","author":"Author-Check- Article-or-Video","date":"April 14, 2015","format":false,"excerpt":"-\u09ae\u09be\u09b8\u09c1\u09a6- \u00a0 \u0986\u099c\u0995\u09c7 \u0986\u09ae\u09b0\u09be \u099c\u09be\u09a8\u09ac\u09cb \u098f\u0987\u099a\u099f\u09bf\u098f\u09ae\u098f\u09b2 \u0987\u09a8\u09aa\u09c1\u099f \u09b8\u09ae\u09cd\u09aa\u09b0\u09cd\u0995\u09c7\u0964 \u099f\u09c7\u0995\u09cd\u09b8\u099f \u0987\u09a8\u09aa\u09c1\u099f \u09b8\u09be\u09a7\u09be\u09b0\u09a8 \u09a4\u09a5\u09cd\u09af \u0997\u09cd\u09b0\u09b9\u09a3 \u0995\u09b0\u09a4\u09c7 \u099f\u09c7\u0995\u09cd\u09b8\u099f \u0987\u09a8\u09aa\u09c1\u099f \u09ac\u09cd\u09af\u09ac\u09b9\u09c3\u09a4 \u09b9\u09df\u0964 \u098f\u09a7\u09b0\u09a8\u09c7\u09b0 \u0987\u09a8\u09aa\u09c1\u099f \u098f\u0995 \u09b2\u09be\u0987\u09a8\u09c7\u09b0 \u09b9\u09df\u09c7 \u09a5\u09be\u0995\u09c7\u0964 <form> First name:<br> <input type=\"text\" name=\"firstname\"> <br> Last name:<br> <input type=\"text\" name=\"lastname\"> <\/form> \u00a0 \u0989\u09aa\u09b0\u09cb\u0995\u09cd\u09a4 \u0995\u09cb\u09a1\u099f\u09bf \u0993\u09df\u09c7\u09ac \u09ac\u09cd\u09b0\u09be\u0989\u099c\u09be\u09b0\u09c7 \u09a6\u09c7\u0996\u09be \u09af\u09be\u09ac\u09c7 \u098f\u09ad\u09be\u09ac\u09c7\u0983 First name: Last name: \u00a0\u2026","rel":"","context":"In &quot;\u098f\u0987\u099a\u099f\u09bf\u098f\u09ae\u098f\u09b2 HTML&quot;","block_context":{"text":"\u098f\u0987\u099a\u099f\u09bf\u098f\u09ae\u098f\u09b2 HTML","link":"http:\/\/bangla.sitestree.com\/?cat=494"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/10562","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/130"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10562"}],"version-history":[{"count":1,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/10562\/revisions"}],"predecessor-version":[{"id":10563,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/10562\/revisions\/10563"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10562"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10562"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10562"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}