title: Validate Python Tkinter name entry by clicking button?
body: <p>So here I have a program which first displays a information message and then you click next and it tells you to input your name before opening up the main window.</p>
  <p>INFO -&gt;(next) ENTER NAME -&gt;(next)</p>
  <p>When I enter my name in the entry box I want it to be checked that it does not contain 1.numbers and 2.is not blank. under the validate=&quot;key&quot; option it means that once I start typing it validates. But rather I want it to only check the name once i press the NEXT button... If not it will open errorbox()</p>
  <pre><code>class errorbox():
      def __init__(self):
          windowError = Tk()
          windowError.title(&quot;Error&quot;)
          windowError.geometry('300x400')
          error_message = Label(windowError, font=(&quot;Bold&quot;, 10), justify=&quot;left&quot;, text=&quot;Please enter a valid name&quot;)
          
  def clicked1():
      description.configure(text=&quot;Please enter your name&quot;)
      nameBox = Entry(windowSplash, width=20, textvariable=name)
      nameBox.place(rely=0.5, x=130, anchor=W)
      reg = windowSplash.register(validate)
      nameBox.config(validate=&quot;none&quot;,validatecommand=clicked2)
      button2 = Button(text=&quot;Next&quot;, bg=&quot;white&quot;, width=5, command=lambda:[clicked2(),validate()])
      button2.place(rely=0.5, x=300, anchor=E)
      button1.destroy()
  
  def validate(input):
      if input.isdigit():
          print(&quot;Invalid name was entered&quot; + input)
          errorbox()
          return False
      elif input is &quot;&quot;:
          print(&quot;No name entered&quot;)
          errorbox()
          return False
      else:
          
          return True
  
  def clicked2():
      print(name.get(), &quot;logged in...&quot;)
      windowSplash.destroy()
      windowTool = Tk()
      windowTool.title(&quot;Radial Measurements Calculator Tool&quot;)
      windowTool.geometry('300x400')
  
  name = StringVar()
  
  windowSplash.mainloop()
  
  </code></pre>