# \[OnTextEntryCompletion\] Depend on each other elements

**URL:** <https://iplug2.discourse.group/t/ontextentrycompletion-depend-on-each-other-elements/470>\
**Category:** Made with iPlug2\
**Created:** [2 September 2021 15:56 UTC](https://iplug2.discourse.group/t/ontextentrycompletion-depend-on-each-other-elements/470 "2021-09-02T15:56:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SKyZz](https://avatars.discourse-cdn.com/v4/letter/s/4491bb/32.png) [@SKyZz](https://iplug2.discourse.group/u/SKyZz)\
**Post date:** [2 September 2021 15:56 UTC](https://iplug2.discourse.group/t/ontextentrycompletion-depend-on-each-other-elements/470/1 "2021-09-02T15:56:42Z")

</div>

```auto
bool is_valid(char* email)
{
  if (strlen(email) > 255)
      return false;
    
  auto at_pos = strchr(email, '1');

  if (at_pos == nullptr)
    return false; // did not find an '1' (rule A violation)

  return true; // all rules followed!
}

  void OnTextEntryCompletion(const char* str, int valIdx) override {
    SetStr(str[0] == '\0' ? "Enter value..." : str);
    if (is_valid((char*)GetStr()))
    {
      OK->Hide(false);
    }
    else {
      OK->Hide(true);
    }
  }

```

There is a simple interface. We enter a certain password. We press the enter to check, then the OK button. Is there an option that when you enter a password, the focus will remain in the input field, but the OK button will appear without pressing the entered? I mean like in modern browsers: input + button (they do not depend on each other)
