Do you know if there’s a library I can use to create a PDF with ADA compliance?
I have searched for something like that but I haven’t found anything.
Thanks,
Blancer.com Tutorials and projects
Freelance Projects, Design and Programming Tutorials
Category Added in a WPeMatico Campaign
Do you know if there’s a library I can use to create a PDF with ADA compliance?
I have searched for something like that but I haven’t found anything.
Thanks,
can I do a warning validate from Datepicker and alert swal like this?
i do that and it error that is_string is not defined….
H E L P
i’m new in php btw
p.s. comment is a think that i tried to make in different way sorry abort that
form
<div class="form-group">
<label>Birthdate</label>
<div class="input-group date">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span><input type="text" class="form-control datepicker_class" id="birth_date" name="birth_date" onchange="validateAge">
</div>
</div>
function
function validateAge(){
var birthday = new $('#birth_date').val();
// let birthday = $('#birth_date').val();
// check = explode('/',birthday);
birthday = explode("/", birthday);
// alert(check);
if (is_string(birthday)) {
birthday = strtotime(birthday);
}
// check
// 31536000 is the number of seconds in a 365 days year. strtotime for 1 years : 31556926
if(time() - birthday < 18 * 31556926) {
swal({
title: "warning",
text: "your age is lower than 18",
type: "warning"
});
}
return true;
}
how to add subscript and superscript in LineControl editor
editor
I have created a newsfeed app where user can search according to publisher and title
and I have two routes / and /publisher and let’s say when I am on / I render the button and when I search and got the results I want to show only results and hide the buttons. i have created different component for search and result rendering here is the current working web app can anyone suggest a solution to get the result
https://newsfeed-33137.web.app/
function multiplyAll(arr) {
let product = 1;
for (let i = 0; i < arr.lenght; i++) {
for (let j = 0; j < arr[i].length; j++) {
product = product * arr[i][j];
//console.log(product);
}
}
return product;
}
In the first for loop length has been misspelt but the the code doesn’t throw any error and does not even run.
I am pushing my items in an array (table format) and then I am showing
that array in the table but it gets undefined.
class Invoice extends Component{
state= {
addItems = [];
}
template=()=>{
let items = "";
let items_array = [];
for(let i=0;i<this.state.addItems.length;i++)
{
items = (
<tr>
<td></td>
</tr>
)
items_array.push(items);
}
const html=`
<html>
<body>
<table>
<thead>
<tr>
<th>Item Name</th>
</tr>
</thead>
<tbody>
${items_array}
</tbody>
</table>
</body>
</html>
`
return html;
}
printToFile = async () => {
const html = this.template();
const { uri } = await Print.printToFileAsync({
html,
});
}
render(){
return(
<Button onPress={this.printToFile}>Print</Button>
)
}
}
Can anyone figure out what’s wrong with the code.
I’ve joined a new project and I see that there are many places that duplicate axios request boilerplate code, for example the following file:
export class Api {
static sendEmail = async (mail: string) => {
const response = await axios({
method: 'post',
url: `${apiUrl}/auth/login`,
headers: {
Accept: 'application/json',
'Content-Type': 'application/json'
},
data: {
email: mail
}
});
return response;
};
static getAdminDashboardData = async () => {
const response = await axios({
method: 'get',
url: `${apiUrl}/admin/dashboard`,
headers: {
Authorization: `Bearer ${accessToken}`,
'Content-Type': 'application/json'
}
});
return response;
};
static getIndices = async () => {
const response = await axios({
method: 'get',
url: `${apiUrl}/admin/indices`,
headers: {
Authorization: `Bearer ${accessToken}`,
'Content-Type': 'application/json'
}
});
return response;
};
static getListHr = async () => {
const response = await axios({
method: 'get',
url: `${apiUrl}/admin/partenaires`,
headers: {
Authorization: `Bearer ${accessToken}`,
'Content-Type': 'application/json'
}
});
return response;
};
static getListProvider = async () => {
const response = await axios({
method: 'get',
url: `${apiUrl}/admin/prestataires`,
headers: {
Authorization: `Bearer ${accessToken}`,
'Content-Type': 'application/json'
}
});
return response;
};
}
So I want to create a common file for all api calls. This is what I came up with so far.
import axios from 'axios';
export default axios.create({
baseURL: 'http://localhost:8080/api',
headers: {
'Content-type': 'application/json'
}
});
I know this file should be a little more advanced, i.e. filled with more options, so maybe someone can recommend how to structure it.
I want to get the first element after the last on the next button clicked after the last.
currently, it shows blank spaces 4times then shows the first element.
A Webinar on Compliance burden in India & how to manage it effectively
A Webinar on Indian Employers must evaluate 8 changes every day to 58,000 compliances. How?
Webinar on How to Choose the Right Compliance Management Software?
Webinar on Digitising Labour Compliance
Webinar on 5 Most Common Roadblocks in Implementing Compliance Management Software
A Webinar on Key Challenges by faced by Compliance Officers in India! Can Technology Help?
Webinar on How to Choose the Right Compliance Management Software for your Company?
Webinar on Compliance Management Software in India
Previous
Next
The code below is meant to put links in words, but it works only with english words, I would like it to work with arabic words too
The code
<script>
// <![CDATA[
document.addEventListener("DOMContentLoaded", function(){
var links = {
"مغامرات": "https://www.example.com/search/label/%D9%85%D8%BA%D8%A7%D9%85%D8%B1%D8%A7%D8%AA",
"East": "https://www.example.com/search/label/%D8%AE%D9%8A%D8%A7%D9%84",
}
var bodi = document.querySelectorAll("body *:not(script)");
for(var x=0; x<bodi.length; x++){
var html = bodi[x].innerHTML;
for(var i in links){
var re = new RegExp("([\s| ]"+i+"(?:(?=[,<.\s])))", "gi");
var matches = html.match(re);
if(matches){
matches = html.match(re)[0].trim();
html = html.replace(re, function(a){
return ' <a href="'+links[i]+'">'+a.match(/[A-zÀ-ú]+/)[0].trim()+'</a>';
});
}
}
bodi[x].innerHTML = html;
}
});
// ]]>
</script>
I have a class like this:
export class Test {
#foo
#bar
constructor() {}
get foo() {
if (!this.#foo) this.#foo = 1 * 1
return this.#foo
}
get bar() {
if (!this.#bar) this.#bar = 2 * 2
return this.#bar
}
}
I need all the getters results in this class so I want to invoke all of them.
I have tried to invoke them outside the class but there are private members in the class so I get an error:
TypeError: Cannot read private member #foo from an object whose class did not declare it
I have tried to invoke them inside the constructor by looping on Object.getOwnPropertyNames(this)
but this don’t invoke the getters.
Is there a way I can invoke them inside the class so the getters can use the private members?
Thanks!
Codesandbox: https://codesandbox.io/s/gallant-cori-hdj5w?file=/src/App.js
I have this simple component with two animations: the first one on the height (from 0% to 100%) and the second one on the max-height.
I didn’t understand why they works but not at the same time: the second animation seems like waits the first animation to finish before to start.
The expected behaviour is that both the animation start and end together.
What is the problem?
For a project I am currently working on I’m trying to find a way that lets me turn a specific google sheets tab into a pdf using javascript
I’m trying to create a regex search in Datatables which matches a user who belongs to all selected groups.
Example:
User A belongs to Delta, Year 6, Year 6 Netball Team
User B belongs to Delta, Year 6 Netball Team
If Delta and Year 6 are selected as filters, only user A should show in the table. The problem I’m having is that both users are showing when these filters are selected. I don’t think the regex is matching exact strings and, after looking through multiple other answers, I don’t seem to be able to get it to do so.
My solution:
if (!this.items.length) {
table.column(i).search('');
} else {
let regex = '^';
this.items.forEach(v => regex += `(?=.*\b${v}\b)`);
regex += '.*$'
table.column(i).search(regex, true, false, true)
}
Which results in: ^(?=.*bDeltab)(?=.*bYear 6b).*$
However, as shown, the user belonging to Delta,Year 6 Netball Team is still being returned.
I have a line chart that allows multiple lines to appear on the same chart depending on the items. However, the amount of items is different as it is based on individuals. Therefore, I would need to have get distinct colors for all the items. The users can pick which items to be visible on the chart. Therefore, the amount of colors needed will be increased when the user picking more items to be visible. As the amount of colors increases, each color should be distinct and distinguishable at first but gradually become similar to each other. Would like to know whether there is a library or segment of code to achieve the objective above?
I’m trying to figure out how to make this work.
I want the validation
function to check if all the user inputs are true, then a message in success
ID will show You have successfully created an account.
once the submit button is clicked.
HTML:
<html>
<head>
<title>Simple Registration Form</title>
<link rel="stylesheet" href="style.css" />
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<form id="myForm" action="#">
<div class="container">
<div class="content">
<label>
First name:
<br /><input
type="text"
id="fname"
placeholder="Enter first name"
/><br />
<span class="notif" id="fn"></span><br />
</label>
<label>
Last name:
<br /><input
type="text"
id="lname"
placeholder="Enter last name"
/><br />
<span class="notif" id="ln"></span><br />
</label>
<label>
Birthdate:
<br /><input
type="date"
id="birthdate"
placeholder="Enter birthdate"
/><br />
<span class="notif" id="bday"></span>
</label>
<label>
<br />Gender: <br /><select id="gender">
<option value="select">Select</option>
<option value="male">Male</option>
<option value="female">Female</option></select
><br />
<span class="notif" id="gndr"></span><br />
</label>
</div>
<div class="content">
<label>
Username:
<br /><input
type="text"
id="username"
placeholder="Enter username"
pattern="[a-zA-Z]+"
/><br />
<span class="notif" id="usr"></span><br />
<div id="msg">
<p id="alphabets" class="invalid">Alphabets only.</p>
</div>
<br />
</label>
<label>
E-mail:
<br /><input
type="email"
id="email"
placeholder="Enter e-mail"
/><br />
<span class="notif" id="eml"></span><br />
<div id="emlForm">
<p id="emailFormat" class="invalid">Invalid format.</p>
</div>
<br />
</label>
<label>
Confirm E-mail:
<br /><input
type="email"
id="econf"
placeholder="Retype e-mail"
/><br />
<span class="notif" id="rt-eml"></span><br />
</label>
<label>
Password:
<br /><input
type="password"
id="password"
placeholder="Enter password"
/><br />
<span class="notif" id="pass"></span><br />
<div id="message">
<p id="letter" class="invalid">Lowercase letter</p>
<p id="capital" class="invalid">Uppercase letter</p>
<p id="number" class="invalid">Number</p>
<p id="special" class="invalid">Special character</p>
<p id="length" class="invalid">Minimum 8 characters</p>
</div>
<br />
</label>
<label>
Confirm Password:
<br /><input
type="password"
id="pconf"
placeholder="Retype password"
/><br />
<span class="notif" id="rt-pass"></span><br />
</label>
</div>
<div>
<input
type="submit"
class="btn"
onclick="validation(); validatePassword();"
value="Submit"
/>
<input
type="reset"
class="btn"
id="reset"
onclick="resetErrors();"
value="Reset"
/>
<br /><br />
</div>
<br /><span class="notif" id="success"></span><br />
</div>
</form>
<script src="script.js"></script>
</body>
</html>
JS:
function validation() {
var fname = document.getElementById('fname').value;
if (fname == '') {
document.getElementById('fn').innerHTML = 'Please enter first name.';
}
var lname = document.getElementById('lname').value;
if (lname == '') {
document.getElementById('ln').innerHTML = 'Please enter last name.';
}
var birth = document.getElementById('birthdate').value;
if (birth == '') {
document.getElementById('bday').innerHTML = 'Please enter birthdate.';
}
var gender = document.getElementById('gender').value;
if (gender == 'select') {
document.getElementById('gndr').innerHTML = 'Please choose your gender.';
}
var username = document.getElementById('username').value;
if (username == '') {
document.getElementById('usr').innerHTML = 'Please enter username.';
}
var email = document.getElementById('email').value;
if (email == '') {
document.getElementById('eml').innerHTML = 'Please enter email.';
}
var econf = document.getElementById('econf').value;
if (econf == '') {
document.getElementById('rt-eml').innerHTML = 'Please confirm your email.';
}
if (econf != email) {
document.getElementById('rt-eml').innerHTML = 'Email did not match.';
}
var password = document.getElementById('password').value;
if (password == '') {
document.getElementById('pass').innerHTML = 'Please enter password.';
}
var pconf = document.getElementById('pconf').value;
if (pconf == '') {
document.getElementById('rt-pass').innerHTML =
'Please confirm your password.';
}
if (pconf != password) {
document.getElementById('rt-pass').innerHTML =
'Password did not match. Try again. ';
}
}
function reset() {
document.getElementById('myForm').reset();
}
function resetErrors() {
document.querySelectorAll('.notif').forEach(el => (el.innerHTML = ''));
}
var alphabetInput = document.getElementById('username');
var alphabets = document.getElementById('alphabets');
alphabetInput.onfocus = function () {
document.getElementById('msg').style.display = 'block';
};
alphabetInput.onblur = function () {
document.getElementById('msg').style.display = 'none';
};
alphabetInput.onkeyup = function () {
var alphabetOnly = /^[A-Za-z]+$/;
if (alphabetInput.value.match(alphabetOnly)) {
alphabets.classList.remove('invalid');
alphabets.classList.add('valid');
} else {
alphabets.classList.add('valid');
alphabets.classList.add('invalid');
}
};
var emailInput = document.getElementById('email');
var emailFormat = document.getElementById('emailFormat');
emailInput.onfocus = function () {
document.getElementById('emlForm').style.display = 'block';
};
emailInput.onblur = function () {
document.getElementById('emlForm').style.display = 'none';
};
emailInput.onkeyup = function () {
var emlFormat = /[@]/;
if (emailInput.value.match(emlFormat)) {
emailFormat.classList.remove('invalid');
emailFormat.classList.add('valid');
} else {
emailFormat.classList.add('valid');
emailFormat.classList.add('invalid');
}
};
var myInput = document.getElementById('password');
var letter = document.getElementById('letter');
var capital = document.getElementById('capital');
var number = document.getElementById('number');
var length = document.getElementById('length');
var special = document.getElementById('special');
myInput.onfocus = function () {
document.getElementById('message').style.display = 'block';
};
myInput.onblur = function () {
document.getElementById('message').style.display = 'none';
};
myInput.onkeyup = function () {
var lowerCaseLetters = /[a-z]/g;
if (myInput.value.match(lowerCaseLetters)) {
letter.classList.remove('invalid');
letter.classList.add('valid');
} else {
letter.classList.remove('valid');
letter.classList.add('invalid');
}
var specialCharacters = /[!@#$%^&*]/g;
if (myInput.value.match(specialCharacters)) {
special.classList.remove('invalid');
special.classList.add('valid');
} else {
special.classList.remove('valid');
special.classList.add('invalid');
}
var upperCaseLetters = /[A-Z]/g;
if (myInput.value.match(upperCaseLetters)) {
capital.classList.remove('invalid');
capital.classList.add('valid');
} else {
capital.classList.remove('valid');
capital.classList.add('invalid');
}
var numbers = /[0-9]/g;
if (myInput.value.match(numbers)) {
number.classList.remove('invalid');
number.classList.add('valid');
} else {
number.classList.remove('valid');
number.classList.add('invalid');
}
if (myInput.value.length >= 8) {
length.classList.remove('invalid');
length.classList.add('valid');
} else {
length.classList.remove('valid');
length.classList.add('invalid');
}
};
var their_date = new Date(2010, 6, 17);
var today = new Date();
var date2 = new Date(
today.getFullYear(),
today.getMonth() + 1,
today.getDate()
);
var diff = new Date(date2.getTime() - their_date.getTime());
console.log(diff.getUTCFullYear() - 1970); // Gives difference as year
CSS:
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300&display=swap');
* {
font-family: 'Poppins', sans-serif;
font-weight: bold;
margin: 0;
padding: 0;
line-height: 1;
font-size: 14px;
top: 20%;
}
.container {
top: 100px;
position: relative;
width: 450px;
max-width: 100%;
grid-column-gap: 50px;
margin: auto;
display: grid;
grid-template-columns: auto auto;
padding: 10px;
box-shadow: 0 3px 10px rgb(0 0 0 / 0.5);
border-radius: 5px;
}
.content {
margin: 0;
padding: 0;
}
.btn {
margin: 0;
position: relative;
top: 50%;
-ms-transform: translateY(-50%);
transform: translateY(-50%);
width: 70px;
height: 25px;
cursor: pointer;
align-items: center;
border-radius: 5px;
}
.btn:active {
background-color: rgb(190, 190, 190);
}
.notif {
font-size: 11px;
color: red;
}
input[type='date'] {
overflow: hidden;
padding: 0;
width: 140px;
-webkit-padding-start: 1px;
border-radius: 5px;
padding-left: 0.5em;
font-size: 12px;
}
input[type='text'],
input[type='email'],
input[type='password'] {
border-radius: 5px;
padding-left: 0.5em;
width: 180px;
font-size: 12px;
}
span[id='success'] {
color: rgb(0, 202, 0);
}
#message {
display: none;
background: #ffffff;
color: #000;
padding: 0;
margin-top: 0;
margin-left: 5px;
}
#message p {
padding: 1px 2px;
font-size: 12px;
}
/* Add a green text color and a "✔" when the requirements are right */
.valid {
color: green;
}
.valid:before {
position: relative;
left: -3px;
content: '✔';
}
/* Add a red text color and an "x" when the requirements are wrong */
.invalid {
color: red;
}
.invalid:before {
position: relative;
left: -5px;
content: '✖';
}
:required {
background: red;
}
#msg {
display: none;
background: #ffffff;
color: #000;
padding: 0;
margin-top: 0;
margin-left: 5px;
}
#msg p {
padding: 1px 2px;
font-size: 12px;
}
/* Add a green text color and a "✔" when the requirements are right */
.valid {
color: green;
}
.valid:before {
position: relative;
left: -3px;
content: '✔';
}
/* Add a red text color and an "x" when the requirements are wrong */
.invalid {
color: red;
}
.invalid:before {
position: relative;
left: -5px;
content: '✖';
}
:required {
background: red;
}
#emlForm {
display: none;
background: #ffffff;
color: #000;
padding: 0;
margin-top: 0;
margin-left: 5px;
}
#emlForm p {
padding: 1px 2px;
font-size: 12px;
}
/* Add a green text color and a "✔" when the requirements are right */
.valid {
color: green;
}
.valid:before {
position: relative;
left: -3px;
content: '✔';
}
/* Add a red text color and an "x" when the requirements are wrong */
.invalid {
color: red;
}
.invalid:before {
position: relative;
left: -5px;
content: '✖';
}
:required {
background: red;
}
How can I make this work?