       type         : 'checkbox'
       name         : 'allow'
       label        : @label
+      change       : =>
+        state = @checkbox.getValue()
+        if state
+        then @showExtras()
+        else @hideExtras()
 
     @input = new KDInputView
-      placeholder : 'domain.com, other.edu'
+      placeholder  : 'domain.com, other.edu'
+      name         : 'domains'
+      defaultValue : domain  if domain
 
     @button = new KDButtonView
-      title       : 'NEXT'
-      style       : 'SignupForm-button SignupForm-button--green'
-      attributes  : testpath  : 'allowed-domain-button'
-      loader      : yes
-      callback    : =>
-        console.log 'go to invites:'
-        KD.singletons.router.handleRoute '/Team/invite'
+      title      : 'NEXT'
+      style      : 'SignupForm-button SignupForm-button--green'
+      attributes : testpath : 'allowed-domain-button'
+      type       : 'submit'
+
+
+  hideExtras: -> @$('div.extras').hide()
+
+  showExtras: -> @$('div.extras').show()
 
 
   pistachio: ->
 
     """
     <div class='login-input-view tr'>{{> @checkbox}}{{> @label}}</div>
-    <div class='login-input-view'><span>@</span>{{> @input}}</div>
-    <p class='dim'>We guessed a domain for you based on your own email address.</p>
+    <div class='extras'>
+      <div class='login-input-view'><span>@</span>{{> @input}}</div>
+      <p class='dim'>Please type a domain or multiple domains separated by commas.</p>
+    </div>
     {{> @button}}
     """
JView             = require './../core/jview'

module.exports = class TeamAllowedDomainTabForm extends KDFormView



    super options, data

    team = KD.utils.getTeamData()
    if email = team.signup?.email
      domain = email.split('@').last
      domain = null  if domain in mailServices

    @label = new KDLabelView
      title : 'Allow sign up and team discovery with a company email address'
      for   : 'allow'
