       target = e.target or e.srcElement
       cursor = target.selectionStart
       target.value = payform.formatCardExpiry(target.value)
-      if cursor?
+      if cursor? and e.type isnt 'change'
         target.setSelectionRange(cursor, cursor)
 
   formatCardExpiry = (e) ->

      target = e.target or e.srcElement
      cursor = target.selectionStart
      target.value = target.value.replace(/\D/g, '')[0...4]
      if cursor?
        target.setSelectionRange(cursor, cursor)

  # Restrictions

      target = e.target or e.srcElement
      cursor = target.selectionStart
      target.value = payform.formatCardNumber(target.value)
      if cursor? and e.type isnt 'change'
        target.setSelectionRange(cursor, cursor)

  formatCardNumber = (e) ->
