   
   $('#phone-number-verification').hide()
   
+  disablePhone = ->
+    # $(phone_btn).text("Please wait...")
+    $(phone_btn).attr('disabled', 'disabled')
+    $(phone_num).attr('disabled', 'disabled')
+
+  enablePhone = ->
+    $(phone_num).removeAttr('disabled')
+    $(phone_btn).removeAttr('disabled')
+    # $(phone_btn).text("Verify")
+  
+  disablePin = ->
+    # $(pin_btn).text("Please wait...")
+    $(pin_btn).attr('disabled', 'disabled')
+    $(pin_num).attr('disabled', 'disabled')
+    $(more_btn).attr('disabled', 'disabled')
+
+  enablePin = ->
+    $(pin_num).removeAttr('disabled')
+    $(more_btn).removeAttr('disabled')
+    $(pin_btn).removeAttr('disabled')
+    # $(pin_btn).text("Confirm")
+  
   $(document).on "click", "#verify-phone-button", (e) ->
     e.preventDefault()
     $.ajax

      type: "POST",
      url: "/phone_numbers/resend",
      dataType: "JSON",
      success: (response) ->
        showSuccessMessage("PIN has been resent")
      error: (xhr, status, error) ->
        showErrorMessages xhr.responseJSON.error
  
  $(document).on "click", "#confirm-phone-pin", (e) ->

      data: { phone_number: $("#user_phone_number").val() },
      url: "/phone_numbers",
      dataType: "JSON",
      beforeSend: ->
        disablePhone()
      success: (response) ->
        enablePhone()
        $('#phone-number-input').toggle('slide')
        $('#phone-number-verification').toggle('slide')
        $('#phone_verification_pin').focus()
        showSuccessMessage("PIN has been sent to your phone number for verification")
      error: (xhr, status, error) ->
        enablePhone()
        showErrorMessages xhr.responseJSON.error
  
  $(document).on "click", "#retry-phone-pin", (e) ->
    e.preventDefault()
    $('#phone-number-verification').toggle('slide')
    $('#phone-number-input').toggle('slide')
  
  $(document).on "click", "#resend-phone-pin", (e) ->
    e.preventDefault()
