Home > Mobile >  is it possible to add form data in QR code?
is it possible to add form data in QR code?

Time:12-28

i want to make Visiting card where user enter its values in a form like name , place , address and those values get converted into qr code and when someone scans it we see that visiting card appears in a dialog ,is it possible to generate a vcard using javascript. i am not finding an solution on internet

CodePudding user response:

It's pretty easy to add vcard data because it's just text, and so you can just feed it into your QRCode generator. For the formatting, I've just copy and pasted from the vCard Wikipedia page.

var qrcode = new QRCode(
  "qr",
  [
    "BEGIN:VCARD",
    "VERSION:2.1",
    "N:Doe;John;;Dr;",
    "FN:Dr. John Doe",
    "EMAIL:[email protected]",
    "TEL;TYPE=cell:(123) 555-5832",
    "END:VCARD"
  ].join("\r\n")
);
<script src="https://cdn.rawgit.com/davidshimjs/qrcodejs/gh-pages/qrcode.min.js"></script>
<div id="qr"></div>

  • Related