title: Eureka Forms Swift enable and disable button
body: <p>I'm using Eureka Forms to make a Register functions in my app.</p>
  
  <p>And I would like to figure out this issue.</p>
  
  <p>The user has some fields that is required to give us. Until he rights down all the info and he check all the buttons that we want, I would like the button submit to be Disabled or Hidden. And when the rows that are required, are completed, then the button should be available / shown.</p>
  
  <p>This is the Class that i've made with eureka</p>
  
  <pre><code>class RegisterViewController: FormViewController {
  
      var xwra = 1
      override func viewDidLoad() {
          super.viewDidLoad()
  
          LabelRow.defaultCellUpdate = { cell, row in
              cell.contentView.backgroundColor = .red
              cell.textLabel?.textColor = .white
              cell.textLabel?.font = UIFont.boldSystemFont(ofSize: 13)
              cell.textLabel?.textAlignment = .right
  
          }
  
          TextRow.defaultCellUpdate = { cell, row in
              if !row.isValid {
                  cell.titleLabel?.textColor = .red
              }
          }
          PhoneRow.defaultCellUpdate = { cell, row in
              if !row.isValid {
                  cell.titleLabel?.textColor = .red
              }
          }
          PickerInlineRow&lt;String&gt;.defaultCellUpdate = { cell, row in
              if !row.isValid {
                  cell.backgroundColor = .red
              }
          }
  
          PasswordRow.defaultCellUpdate = { cell, row in
              if !row.isValid {
                  cell.titleLabel?.textColor = .red
              }
          }
          ButtonRow.defaultCellUpdate = { cell, row in
              cell.textLabel?.numberOfLines = 0
          }
  
          form +++ Section("Τα Προσωπικά Στοιχεία σας")
              &lt;&lt;&lt; TextRow("name"){ row in
                  row.title = "Όνομα"
                  row.add(rule: RuleRequired())
                  row.validationOptions = .validatesOnChange
                  row.placeholder = "Enter text here"
                  }
                  .cellUpdate { cell, row in
                      if !row.isValid {
                          cell.titleLabel?.textColor = .red
                      }
              }
              &lt;&lt;&lt; TextRow("surname"){ row in
                  row.title = "Επώνυμο"
                  row.add(rule: RuleRequired())
                  row.placeholder = "Enter text here"
              }
              &lt;&lt;&lt; TextRow("email"){ row in
                  row.title = "Email"
                  row.add(rule: RuleRequired())
                  row.add(rule: RuleEmail())
                  row.placeholder = "Enter text here"
              }
              &lt;&lt;&lt; PhoneRow("phone"){
  
                  $0.title = "Τηλέφωνο"
                  $0.add(rule: RuleRequired())
                  $0.placeholder = "Enter text here"
              }
              &lt;&lt;&lt; PhoneRow("fax"){
                  $0.title = "Φαξ"
                  $0.placeholder = "And numbers here"
              }
              +++ Section("Η Διεύθυνση σας")
              &lt;&lt;&lt; TextRow("company"){ row in
                  row.title = "Επωνυμία"
                  row.add(rule: RuleRequired())
                  row.placeholder = "Enter text here"
          }
              &lt;&lt;&lt; TextRow("job"){ row in
                  row.title = "Επάγγελμα"
                  row.add(rule: RuleRequired())
                  row.placeholder = "Enter text here"
          }
              &lt;&lt;&lt; TextRow("afm"){ row in
                  row.title = "Α.Φ.Μ. / Δ.Ο.Υ"
                  row.add(rule: RuleRequired())
                  row.placeholder = "Enter text here"
          }
              &lt;&lt;&lt; TextRow("address1"){ row in
                  row.title = "Διεύθυνση 1"
                  row.add(rule: RuleRequired())
                  row.placeholder = "Enter text here"
          }
              &lt;&lt;&lt; TextRow("address2"){ row in
                  row.title = "Διεύθυνση 2"
                  row.placeholder = "Enter text here"
          }
              &lt;&lt;&lt; TextRow("town"){ row in
                  row.title = "Πόλη"
                  row.add(rule: RuleRequired())
                  row.placeholder = "Enter text here"
          }
              &lt;&lt;&lt; TextRow("tk"){ row in
                  row.title = "Τ.Κ."
                  row.add(rule: RuleRequired())
                  row.placeholder = "Enter text here"
          }
              &lt;&lt;&lt; PickerInlineRow&lt;String&gt;("countrytag") {
                  $0.title = "Χώρα"
                  $0.options = ["Ελλάδα", "Κύπρος"]
                  $0.add(rule: RuleRequired())
                  }.onChange { row in
                      if row.value == "Ελλάδα" {
                          self.xwra = 1
                      } else {
                          self.xwra = 0
                      }
              }
              &lt;&lt;&lt; PickerInlineRow&lt;String&gt;("loctag") {
                  $0.title = "Πόλη"
                  $0.add(rule: RuleRequired())
                  }.onCellSelection({ (cell, row) in
                      if self.xwra == 1 {
                          print("its one")
                          row.options = ["Ελλάδα", "Κύπρος", "Κύπρος", "Κύπρος", "Κύπρος"]
                          row.updateCell()
                      } else {
                          print("its not one")
                          row.options = ["Ελλάδα"]
                          row.updateCell()
                      }
                  })
              +++ Section(header: "O Κωδικος σας", footer: "Θα πρέπει να είναι ίδιος και στα δύο πεδία.")
  
              &lt;&lt;&lt; PasswordRow("password") {
                  $0.title = "Password"
              }
              &lt;&lt;&lt; PasswordRow() {
                  $0.title = "Confirm Password"
                      $0.add(rule: RuleEqualsToRow(form: form, tag: "password"))
                  }
                  .cellUpdate { cell, row in
                      if !row.isValid {
                          cell.titleLabel?.textColor = .red
                      }
              }
  
              +++ Section("Λήψη Ενημερωτικών Δελτίων")
              &lt;&lt;&lt; SwitchRow("SwitchRow") { row in
                  row.title = "The title"
                      }
  
              +++ SelectableSection&lt;ImageCheckRow&lt;String&gt;&gt;("", selectionType: .singleSelection(enableDeselection: true))
              &lt;&lt;&lt; ImageCheckRow&lt;String&gt;(){ lrow in
                  lrow.title = "Έχω διαβάσει και αποδέχομαι τους όρους χρήσης - δήλωσης απορρήτου"
                  lrow.selectableValue = ""
                  lrow.value = nil
                  }.cellSetup { cell, _ in
                      cell.trueImage = UIImage(named: "selectedRectangle")!
                      cell.falseImage = UIImage(named: "unselectedRectangle")!
  
              }
  
              &lt;&lt;&lt; ButtonRow("terms") {
                  $0.title = "Όροι Χρήσης - Δήλωση Απορρήτου"
                  $0.presentationMode = .segueName(segueName: "oroi", onDismiss: nil)
              }
  
              &lt;&lt;&lt; ButtonRow("register") {
                  $0.title = "Εγγραφή"
                  $0.cell.backgroundColor = .red
                  $0.cell.tintColor = .white
                  }
                  .onCellSelection { cell, row in
                      //send data to server function
  
          }
      }
  
    }
  </code></pre>
  
  <p>Could someone point me of how to make it work?
  Thanks a lot!</p>
  
  <p>Update 1.</p>
  
  <p>The last button</p>
  
  <pre><code>&lt;&lt;&lt; ButtonRow("register") {
                  $0.title = "Εγγραφή"
                  $0.cell.backgroundColor = .red
                  $0.cell.tintColor = .white
                  }
                  .onCellSelection { cell, row in
                      row.section?.form?.validate()
  
          }
  </code></pre>
  
  <p>On cell selection, check all the data that are required and if they are not OK the text goes red. 
  So the question is again the same. How do i run the send to server function in case validation is true?</p>