problem to create a customize qr code generator when i generate qr code for vcard then it generate color qr code but when i generate qr code for url then it generate default qr code color (black and white) how i correct it #101813
Unanswered
Mackmaxx
asked this question in
Programming Help
Replies: 1 comment
-
|
Thanks for posting in the GitHub Community, @Mackmaxx ! We're happy you're here. You are more likely to get a useful response if you are posting your question in the applicable category, the Projects and Issues category is solely related to conversations around the GitHub products Issues and Projects. We’ve moved your post to our Programming Help 🧑💻 category, which is more appropriate for this type of discussion. Please review our guidelines about the Programming Help category for more information. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Show & Tell
Feature Area
Issues
Body
it is my qr.html page
<title>QR Code Generator</title>`
}
.container {
max-width: 600px;
margin: 50px auto;
padding: 20px;
border: 1px solid #ccc;
border-radius: 5px;
}
form {
display: flex;
flex-direction: column;
}
label {
margin-bottom: 5px;
}
input {
margin-bottom: 15px;
padding: 8px;
}
button {
background-color: #4CAF50;
color: white;
padding: 10px;
margin: 10px;
border: none;
border-radius: 5px;
cursor: pointer;
}
button:hover {
background-color: #45a049;
}
#qrcode {
margin-top: 20px;
}
QR Code Generator
function showVCardForm() {
document.getElementById('vCardForm').style.display = 'flex';
document.getElementById('urlForm').style.display = 'none';
resetQRCodeInstance();
}
function showURLForm() {
document.getElementById('vCardForm').style.display = 'none';
document.getElementById('urlForm').style.display = 'flex';
resetQRCodeInstance();
}
function resetQRCodeInstance() {
qrCodeInstance = null;
document.getElementById('qrcode').innerHTML = ''; // Clear previous QR code
}
function generateVCardQR() {
var first_name = document.getElementById('first_name').value;
var last_name = document.getElementById('last_name').value;
var company = document.getElementById('company').value;
var designation = document.getElementById('designation').value;
var email = document.getElementById('email').value;
var mobile = document.getElementById('mobile').value;
var address = document.getElementById('address').value;
var notes = document.getElementById('notes').value;
}
var urlFormLastValue = ''; // Variable to store the last entered URL
function generateURLQR() {
var urlInput = document.getElementById("urlInput");
var url = urlInput.value;
}
function isValidURL(str) {
var pattern = new RegExp('^(https?:\/\/)?' + // protocol
'(((a-z\d)\.)+[a-z]{2,}|' + // domain name
'((\d{1,3}\.){3}\d{1,3}))' + // OR ip (v4) address
'(\:\d+)?(\/[-a-z\d%_.~+])' + // port and path
'(\?[;&a-z\d%_.~+=-])?' + // query string
'(\#[-a-z\d_]*)?$', 'i'); // fragment locator
return !!pattern.test(str);
}
function saveQRCode() {
// Get the QR code image as a data URL
var qrCodeImage = document.getElementById("qrcode").getElementsByTagName('img')[0].src;
}`
https://tallyprimeeducation.in/qrtest/Qrpage.html
Guidelines
Beta Was this translation helpful? Give feedback.
All reactions