{"id":13664,"date":"2023-12-04T11:26:31","date_gmt":"2023-12-04T17:26:31","guid":{"rendered":"https:\/\/www.mrc-productivity.com\/docs\/?post_type=ht_kb&#038;p=13664"},"modified":"2023-12-04T11:27:16","modified_gmt":"2023-12-04T17:27:16","slug":"new-form-input-options","status":"publish","type":"ht_kb","link":"https:\/\/www.mrc-productivity.com\/docs\/knowledge-base\/new-form-input-options","title":{"rendered":"New Form Input Options"},"content":{"rendered":"\n<p>While inputs typically default to traditional input boxes, developers can convert these to other inputs. Most m-Power users are familiar with converting inputs to a drop-down list or a combobox, m-Painter now supports two new input options: Toggle Switches and Bootstrap Radio buttons.\u00a0<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Toggle Switches<\/h2>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-info\">Click <a href=\"https:\/\/www.mrc-productivity.com\/techblog\/?ht_kb=creating-toggle-switches-in-bootstrap-applications\">here<\/a> to view the legacy documentation for this feature.<\/p>\n\n\n\n<p>Toggle switches are an alternative option to a checkbox input. Clicking the switch will slide the toggle to the &#8220;enabled&#8221; option. This input option works best when there is a single value to submit to the database, such as &#8216;Y&#8217;, &#8216;N&#8217;, &#8216;Active&#8217;, &#8216;Inactive&#8217;, etc.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"\/docs\/vue-images\/toggleNo.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"\/docs\/vue-images\/toggleYes.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<p>To implement a toggle switch, you must be using a Maintainer application. <\/p>\n\n\n\n<p>In the Field Settings tab of your maintenance application, change the &#8220;Basic field attributes&#8221; dropdown to &#8220;Form validation and auditing&#8221;. Find the field that you would like to create a toggle switch over.<\/p>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-alert\">This should be a field that only accepts a single value (Yes\/No, 0 or 1, Active or Inactive, etc.)<\/p>\n\n\n\n<p>In the Validity Relation column, select the &#8220;Check box&#8221; option. In the Validity Value column, enter the value you want to write to the database when the switch is toggled on.\u00a0<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/www.mrc-productivity.com\/techblog\/images\/toggleswitch1.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<p>After compiling the maintainer, open m-Painter and locate your checkbox field in your maintainer form page. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"\/docs\/vue-images\/toggleBox.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<p>Select to highlight the checkbox element. On the right-side Element Panel, select the &#8220;Convert Input to&#8230;&#8217; dropdown and select &#8220;Toggle Switch&#8221;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"\/docs\/vue-images\/toggleElementPanel.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<p>Selecting this will immediately convert the checkbox to a toggle switch.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"\/docs\/vue-images\/toggleFinal.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Toggle Switch Options<\/h3>\n\n\n\n<p>The default text for the enabled\/disabled toggle are &#8216;Yes&#8217; and &#8216;No&#8217;. You have the option of customizing the text for these different statuses. <\/p>\n\n\n\n<p>Select the toggle switch in m-Painter and from the Element Panel -> Element Options, scroll down to the &#8220;Toggle Switch Options&#8221; section. Here you can set the desired &#8220;Checked Text&#8221; and the &#8220;Unchecked Text&#8221;.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"\/docs\/vue-images\/toggleOptions.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-alert\">This only impacts the displayed text in the toggle switch. The value submitted will still pull from the set value in the Field Settings.<\/p>\n\n\n\n<p><strong>Note: <\/strong>If changing the toggle text options, you will also need to override the width and max-width styles of the toggle switch in order to accommodate the longer text. To do this, select the &#8220;Styling Overrides&#8221; section from the Element Panel and click &#8220;Class and Style Attributes&#8221;. <\/p>\n\n\n\n<p>Set the following style and change the px size to best suit your needs: width: 100px; max-width: 100px;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"\/docs\/vue-images\/toggleStyleOverride.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<p>Save and run your maintainer.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"\/docs\/vue-images\/toggleInactive.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"\/docs\/vue-images\/toggleActive.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Bootstrap Radio Buttons<\/h2>\n\n\n\n<p>An alternative display option for radio buttons, you can choose to render Bootstrap themed buttons. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"\/docs\/vue-images\/buttonsList.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<p>To implement, select the input you wish to add the button group. Then from the Element Panel, select &#8220;Insert Option List&#8221;. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"\/docs\/vue-images\/buttonsInput.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<p>Select which datasource type will be used to populate the button group: Data Model, m-Power Application, or Quicklist.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"\/docs\/vue-images\/buttonsDatasourceType.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<p>Next, choose the specific dataset to available buttons items from.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"\/docs\/vue-images\/buttonsQuicklist.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<p>Finally, in the List Configuration screen select the &#8220;Bootstrap Buttons&#8221; from the Option List Style.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"\/docs\/vue-images\/buttonsListStyle.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"wp-block-ht-blocks-messages wp-block-hb-message wp-block-hb-message--withicon is-style-alert\">If do not want an option for the user to select\/submit a &#8220;blank&#8221;, be sure to remove the &#8216;Select a value&#8217; text from the &#8220;Blank option text&#8221; input.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"\/docs\/vue-images\/buttonsList.jpg\" alt=\"\"\/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>While inputs typically default to traditional input boxes, developers can convert these to other inputs. Most m-Power users are familiar with converting inputs to a drop-down list or a combobox, m-Painter now supports two new input options: Toggle Switches and Bootstrap Radio buttons.\u00a0 Toggle Switches Toggle switches are an alternative&#8230;<\/p>\n","protected":false},"author":1,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[255],"ht-kb-tag":[306,303,305],"class_list":["post-13664","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-mpainter","ht_kb_tag-bootstrap","ht_kb_tag-form","ht_kb_tag-input"],"_links":{"self":[{"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb\/13664","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/comments?post=13664"}],"version-history":[{"count":3,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb\/13664\/revisions"}],"predecessor-version":[{"id":13669,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb\/13664\/revisions\/13669"}],"wp:attachment":[{"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/media?parent=13664"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb-category?post=13664"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/docs\/wp-json\/wp\/v2\/ht-kb-tag?post=13664"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}