Moving a focus when the input text field reaches a max length

前端 未结 8 1519
北恋
北恋 2020-12-01 03:54

I do have a credit card number form. The number is divided into four parts just as on a real credit card.

I want to add a JavaScript taste to the form where when a u

8条回答
  •  抹茶落季
    2020-12-01 04:20

    This does not have four fields, but it does validate credit cards (integrity check, not Luhn's Algorithm!). I have to tell you how annoying it is to use multiple fields for a user and auto-tabbing. I recommend you only use one field.

    From jquery website:

    $("#myform").validate({
      rules: {
        field: {
          required: true,
          creditcard: true
        }
      }
    });
    

    /

    
    
    
      
      
    
    
    
      
      
    
    
    
    

提交回复
热议问题