A JQuery plugin to take multiple mails from the user.
- Settings can be manipulated via parameters.
- Comma separated mails can be entered at once.
- A hidden input is added so that send the data in a form component.
- Minor bug fix & CSS issues
<div id="outer" class="mmOuter">
<input id="input" class="form-control multiMail"/>
<input id="mails" name="mails" class="multiMailResult"/>
<div id="boxes" class="mmBoxes"></div>
</div>
- With default settings:
var input1 = $(".multiMail").multiMailInput();
var mails = input1.getMails();
- With custom settings:
var input1 = $(".multiMail").multiMailInput({
imageDir: "/images",
validation_error: "is not valid!",
duplicate_error: "is already exist!",
placeholder: "Press comma or tab to add e-mails"
});
var mails = input1.getMails();
//@param mail - Mail string
//addMail(mail)
input1.addMail("mail1@mail.com");
//@param mailArray - An array containing mails
//addMailArray(mailArray)
input1.addMailArray(["mail1@mail.com", "mail2@mail.org", "mail3@mail.co", "mail4@mail.co.uk"]);
//@param mailString - CSV string
//@param delimeter - Comma for csv
//addMailCSV(mailString, delimeter)
input1.addMailCSV("mail1@mail.com,mail2@mail.org,mail3@mail.co,mail4@mail.co.uk", ",");
// Returns a CSV string
input1.getMailsCSV();
- You can separate mails by "," or tab button.
- Mails are validated by regex.
- Can be manipulated dynamically.
- If you see any mistake please do not hesitate to open an issue.
- Any merge request would be appreciated.