         return unless @validateBasicFields()
         @el('#common-fieldset').addClass 'hidden'
 
-        if @student()
+        if @el('#student_account').is(':checked')
           @el('#student-fieldset').removeClass 'hidden'
+          @accountType = 'student'
         else
           @el('#teacher-fieldset').removeClass 'hidden'
+          @accountType = 'teacher'
 
       @el('.submit-form').on 'click', (e) =>
         e.preventDefault()



    showErrors: (errors) ->
      @processTeacherErrors(errors) if @teacher

      for fieldName, error of errors
        $f = @field(fieldName).parent()
        $f.addClass 'error-field'
        $f.prepend "<p class=\"error-message\">#{error}</p>"

    clearErrors: ->
      @$form.find('.error-field').removeClass 'error-field'

        delete errors.school_id

    serializeAndSubmit: ->
      if @isStudent()
        url = API_V1.STUDENTS
      else
        url = API_V1.TEACHERS
