vaf
This commit is contained in:
parent
ff1f456fcd
commit
6cfca4e52b
|
|
@ -154,11 +154,27 @@
|
|||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<label class="form-label small fw-bold text-uppercase">
|
||||
<label class="form-label fw-bold small text-uppercase">
|
||||
<?= _("Téléphone Portable") ?><span class="required-star">*</span>
|
||||
</label>
|
||||
<input class="form-control" type="tel" id="telephonePortable" name="telephonePortable" value="<?= $_SESSION['indicatifTelephone'] ?>" required>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text bg-white text-muted"><i class="fas fa-mobile-alt"></i></span>
|
||||
<input type="tel"
|
||||
class="form-control"
|
||||
id="telephonePortable"
|
||||
name="telephonePortable"
|
||||
placeholder="Ex: 250700000001"
|
||||
required
|
||||
pattern="^250[0-9]{9,}$"
|
||||
title="<?= est_anglophone() ? "The number must start with 250 and contain at least 12 digits." : "Le numéro doit commencer par 250 et comporter au moins 12 chiffres.";?>"
|
||||
oninput="this.setCustomValidity('')"
|
||||
oninvalid="this.setCustomValidity('<?= est_anglophone() ? 'The number must mandatorily start with 250 and contain at least 12 digits in total.' : 'Le numéro doit obligatoirement commencer par 250 et contenir au moins 12 chiffres au total.';?>')">
|
||||
</div>
|
||||
<div class="form-text text-muted small">
|
||||
<i class="fas fa-info-circle"></i> <?= est_anglophone() ? 'Required format: 250XXXXXXXXX (min. 12 digits)' : 'Format requis : 250XXXXXXXXX (min. 12 chiffres)'; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<label class="form-label small fw-bold text-uppercase"><?= _("E-mail") ?></label>
|
||||
<input class="form-control" type="email" id="email" name="email" placeholder="exemple@mail.com">
|
||||
|
|
@ -181,4 +197,16 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
document.getElementById('telephonePortable').addEventListener('input', function (e) {
|
||||
const pattern = /^250[0-9]{9,}$/;
|
||||
if (pattern.test(this.value)) {
|
||||
this.classList.remove('is-invalid');
|
||||
this.classList.add('is-valid');
|
||||
} else {
|
||||
this.classList.remove('is-valid');
|
||||
this.classList.add('is-invalid');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user