{"id":52859,"date":"2023-10-24T15:48:36","date_gmt":"2023-10-24T13:48:36","guid":{"rendered":"https:\/\/www.myscada.org\/?post_type=docs&#038;p=52859"},"modified":"2023-10-24T15:48:36","modified_gmt":"2023-10-24T13:48:36","password":"","slug":"view-script-function-listbox-textbox-combobox-smart-input","status":"publish","type":"docs","link":"https:\/\/amitomation.cz\/en\/documentation\/view-script-function-listbox-textbox-combobox-smart-input\/","title":{"rendered":"View script function &#8211; ListBox, TextBox, ComboBox (Smart input)"},"content":{"rendered":"<h3><span style=\"color: #4baddd;\">Select an Item\/Index<\/span><\/h3>\n<p style=\"text-align: justify;\">For ComboBox and ListBox will select a given item. For TextBox will set value of TextBox to new value.<\/p>\n<pre><span style=\"color: #4baddd;\">myscada.setSelectedItem('id','item');<\/span><\/pre>\n<p style=\"text-align: justify;\">For ComboBox and ListBox will set item to given index.<\/p>\n<pre><span style=\"color: #4baddd;\">myscada.setSelectedIndex('id',3);<\/span><\/pre>\n<h3><span style=\"color: #4baddd;\">Get Selected Item\/Index<\/span><\/h3>\n<p style=\"text-align: justify;\">Will return selected value or undefined if nothing is selected.<\/p>\n<pre><span style=\"color: #4baddd;\">myscada.getSelectedItem('id');<\/span><\/pre>\n<p style=\"text-align: justify;\">Will return selected index eg. hierarchical number of selected element. If nothing is selected, -1 will be returned.<\/p>\n<pre><span style=\"color: #4baddd;\">myscada.getSelectedIndex('id');<\/span><\/pre>\n<h3><span style=\"color: #4baddd;\">Set New Items<\/span><\/h3>\n<p style=\"text-align: justify;\">Will set new items to ListBox or ComboBox. Pass id of element and then array of items.<\/p>\n<pre><span style=\"color: #4baddd;\">myscada.setItems('id',['item1','item2','item3']);<\/span><\/pre>\n<p style=\"text-align: justify;\">Will set value to TextBox.<\/p>\n<pre><span style=\"color: #4baddd;\">myscada.setItems('id','item1');<\/span><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Select an Item\/Index For ComboBox and ListBox will select a given item. For TextBox will set value of TextBox to new value. myscada.setSelectedItem(&#8216;id&#8217;,&#8217;item&#8217;); For ComboBox and ListBox will set item to given index. myscada.setSelectedIndex(&#8216;id&#8217;,3); Get Selected Item\/Index Will return selected value or undefined if nothing is selected. myscada.getSelectedItem(&#8216;id&#8217;); Will return selected index eg. hierarchical number<a class=\"moretag excerpt orangelink\" href=\"https:\/\/amitomation.cz\/en\/documentation\/view-script-function-listbox-textbox-combobox-smart-input\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":2555,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"doc_category":[325],"doc_tag":[],"class_list":["post-52859","docs","type-docs","status-publish","hentry","doc_category-mydesigner-v8"],"year_month":"2026-04","word_count":117,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"name":"Musilda","author_nicename":"musilda","author_url":"https:\/\/amitomation.cz\/en\/author\/musilda\/"},"doc_category_info":[{"term_name":"AMiTDesigner","term_url":"https:\/\/amitomation.cz\/en\/docs-category\/mydesigner-v8\/"}],"doc_tag_info":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>View script function - ListBox, TextBox, ComboBox (Smart input) - AMiT Automation<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/amitomation.cz\/en\/documentation\/view-script-function-listbox-textbox-combobox-smart-input\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"View script function - ListBox, TextBox, ComboBox (Smart input) - AMiT Automation\" \/>\n<meta property=\"og:description\" content=\"Select an Item\/Index For ComboBox and ListBox will select a given item. For TextBox will set value of TextBox to new value. myscada.setSelectedItem(&#039;id&#039;,&#039;item&#039;); For ComboBox and ListBox will set item to given index. myscada.setSelectedIndex(&#039;id&#039;,3); Get Selected Item\/Index Will return selected value or undefined if nothing is selected. myscada.getSelectedItem(&#039;id&#039;); Will return selected index eg. hierarchical number[...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/amitomation.cz\/en\/documentation\/view-script-function-listbox-textbox-combobox-smart-input\/\" \/>\n<meta property=\"og:site_name\" content=\"AMiT Automation\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/amitomation.cz\/en\/documentation\/view-script-function-listbox-textbox-combobox-smart-input\/\",\"url\":\"https:\/\/amitomation.cz\/en\/documentation\/view-script-function-listbox-textbox-combobox-smart-input\/\",\"name\":\"View script function - ListBox, TextBox, ComboBox (Smart input) - AMiT Automation\",\"isPartOf\":{\"@id\":\"https:\/\/amitomation.cz\/en\/#website\"},\"datePublished\":\"2023-10-24T13:48:36+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/amitomation.cz\/en\/documentation\/view-script-function-listbox-textbox-combobox-smart-input\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/amitomation.cz\/en\/documentation\/view-script-function-listbox-textbox-combobox-smart-input\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/amitomation.cz\/en\/documentation\/view-script-function-listbox-textbox-combobox-smart-input\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/amitomation.cz\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Documentation\",\"item\":\"https:\/\/amitomation.cz\/en\/documentation\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"View script function &#8211; ListBox, TextBox, ComboBox (Smart input)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/amitomation.cz\/en\/#website\",\"url\":\"https:\/\/amitomation.cz\/en\/\",\"name\":\"AMiT Automation\",\"description\":\"Czech manufacturer of Control Systems and Industrial Automation Electronics\",\"publisher\":{\"@id\":\"https:\/\/amitomation.cz\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/amitomation.cz\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/amitomation.cz\/en\/#organization\",\"name\":\"AMiT, spol. s r.o.\",\"url\":\"https:\/\/amitomation.cz\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/amitomation.cz\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/amitomation.cz\/wp-content\/uploads\/2017\/07\/amit_automation_100x42.gif\",\"contentUrl\":\"https:\/\/amitomation.cz\/wp-content\/uploads\/2017\/07\/amit_automation_100x42.gif\",\"width\":100,\"height\":42,\"caption\":\"AMiT, spol. s r.o.\"},\"image\":{\"@id\":\"https:\/\/amitomation.cz\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.linkedin.com\/organization\/10939938\/\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"View script function - ListBox, TextBox, ComboBox (Smart input) - AMiT Automation","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/amitomation.cz\/en\/documentation\/view-script-function-listbox-textbox-combobox-smart-input\/","og_locale":"en_US","og_type":"article","og_title":"View script function - ListBox, TextBox, ComboBox (Smart input) - AMiT Automation","og_description":"Select an Item\/Index For ComboBox and ListBox will select a given item. For TextBox will set value of TextBox to new value. myscada.setSelectedItem('id','item'); For ComboBox and ListBox will set item to given index. myscada.setSelectedIndex('id',3); Get Selected Item\/Index Will return selected value or undefined if nothing is selected. myscada.getSelectedItem('id'); Will return selected index eg. hierarchical number[...]","og_url":"https:\/\/amitomation.cz\/en\/documentation\/view-script-function-listbox-textbox-combobox-smart-input\/","og_site_name":"AMiT Automation","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/amitomation.cz\/en\/documentation\/view-script-function-listbox-textbox-combobox-smart-input\/","url":"https:\/\/amitomation.cz\/en\/documentation\/view-script-function-listbox-textbox-combobox-smart-input\/","name":"View script function - ListBox, TextBox, ComboBox (Smart input) - AMiT Automation","isPartOf":{"@id":"https:\/\/amitomation.cz\/en\/#website"},"datePublished":"2023-10-24T13:48:36+00:00","breadcrumb":{"@id":"https:\/\/amitomation.cz\/en\/documentation\/view-script-function-listbox-textbox-combobox-smart-input\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/amitomation.cz\/en\/documentation\/view-script-function-listbox-textbox-combobox-smart-input\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/amitomation.cz\/en\/documentation\/view-script-function-listbox-textbox-combobox-smart-input\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/amitomation.cz\/en\/"},{"@type":"ListItem","position":2,"name":"Documentation","item":"https:\/\/amitomation.cz\/en\/documentation\/"},{"@type":"ListItem","position":3,"name":"View script function &#8211; ListBox, TextBox, ComboBox (Smart input)"}]},{"@type":"WebSite","@id":"https:\/\/amitomation.cz\/en\/#website","url":"https:\/\/amitomation.cz\/en\/","name":"AMiT Automation","description":"Czech manufacturer of Control Systems and Industrial Automation Electronics","publisher":{"@id":"https:\/\/amitomation.cz\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/amitomation.cz\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/amitomation.cz\/en\/#organization","name":"AMiT, spol. s r.o.","url":"https:\/\/amitomation.cz\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/amitomation.cz\/en\/#\/schema\/logo\/image\/","url":"https:\/\/amitomation.cz\/wp-content\/uploads\/2017\/07\/amit_automation_100x42.gif","contentUrl":"https:\/\/amitomation.cz\/wp-content\/uploads\/2017\/07\/amit_automation_100x42.gif","width":100,"height":42,"caption":"AMiT, spol. s r.o."},"image":{"@id":"https:\/\/amitomation.cz\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.linkedin.com\/organization\/10939938\/"]}]}},"_links":{"self":[{"href":"https:\/\/amitomation.cz\/en\/wp-json\/wp\/v2\/docs\/52859","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/amitomation.cz\/en\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/amitomation.cz\/en\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/amitomation.cz\/en\/wp-json\/wp\/v2\/users\/2555"}],"replies":[{"embeddable":true,"href":"https:\/\/amitomation.cz\/en\/wp-json\/wp\/v2\/comments?post=52859"}],"version-history":[{"count":1,"href":"https:\/\/amitomation.cz\/en\/wp-json\/wp\/v2\/docs\/52859\/revisions"}],"predecessor-version":[{"id":53588,"href":"https:\/\/amitomation.cz\/en\/wp-json\/wp\/v2\/docs\/52859\/revisions\/53588"}],"wp:attachment":[{"href":"https:\/\/amitomation.cz\/en\/wp-json\/wp\/v2\/media?parent=52859"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/amitomation.cz\/en\/wp-json\/wp\/v2\/doc_category?post=52859"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/amitomation.cz\/en\/wp-json\/wp\/v2\/doc_tag?post=52859"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}