Validate Multiple Email Addresses with HTML5

前端 未结 3 1174
你的背包
你的背包 2021-02-15 14:06

I\'m trying to construct an email form that takes multiple comma separated emails as an input and verifies them using HTML5. I want to use the following regex to sanity check t

3条回答
  •  情深已故
    2021-02-15 14:18

    You could read the input in with javascript and split the input on commas.

    function() {
    var inputString = document.getElementById('emailinput').value;
    var splitInput = inputString.split(',');
    
    var pattern = /"your regex pattern"/;
    
    var match = true;
    
    for(i=0;i

提交回复
热议问题