title: How to manage input validation and Value State in UI5
body: <p>I need a help in following scenario. I have a input field and 3 checkboxes infront of it. Requirement is - If user enters something in field, he must check one of the checkboxes. While it gives proper value state in the input field, if I click on Submit button, it does not stop on the page. Rather submit action is a completed successfully. I do not want user to submit successfully if the input is in error state. What should I do? I added the following:</p>
  
  <pre><code>XML View:
  &lt;Input id="input" width="25px" change="handleChange" &lt;/Input&gt;
  &lt;CheckBox id="2" text ="Hello" select="ChkSel"&gt; &lt;/CheckBox&gt;
  &lt;CheckBox id="3" text ="Hello2" select="ChkSel"&gt; &lt;/CheckBox&gt;
  &lt;CheckBox id="4" text ="Hello3" select="ChkSel"&gt; &lt;/CheckBox&gt;
  
  Controller:
      handleChange: function(oEvent) {
              var newValue = oEvent.getParameter("value");
              var check1 = this.getView().byId("2").getSelected();
              var check2 = this.getView().byId("3").getSelected();
              var check3 = this.getView().byId("4").getSelected();
  
              if (newValue !== "") {
                  if (!check1 &amp;&amp; !check2 &amp;&amp; !check3) {
                                          this.getView().byId("input").setValueState(sap.ui.core.ValueState.Error);
                      MessageToast.show("Select appropriate checkbox");
                  }
              }
              if (newValue === "") {
                  if (check1 || check2 || check3) {
                     MessageToast.show("Enter text or deselect checkbox");
                  } 
  
              }
  
          },
          ChkSel: function(oEvent) {
              var newValue = this.getView().byId("input").getValue();
              var check1 = this.getView().byId("2").getSelected();
              var check2 = this.getView().byId("3").getSelected();
              var check3 = this.getView().byId("4").getSelected();
              if (newValue !== "") {
                  if (check1 || check2 || check3) {
                      this.getView().byId("input").setValueState("None");
                  } else {
                      this.getView().byId("input").setValueState(sap.ui.core.ValueState.Error);
                  }
  
              }
  </code></pre>