This commit is contained in:
Roman Pyrih
2024-12-02 12:01:34 +01:00
parent 19bc9054fe
commit 49a890c02c
4 changed files with 5136 additions and 5028 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -70,7 +70,21 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<input type="text" id="phone" name="phone" class="form-control" required placeholder="<?= ucfirst( \S::lang( 'telefon' ) );?>" value="<?= htmlspecialchars( $address_current['phone'] );?>"> <div class="form-control form-control-phone" tooltip="Wprowadź numer w formacie: 123456789">
<div class="form-control-phone-code">
<img src="/images/system/lang_pl.png" alt="">
<span>+48</span>
</div>
<input
type="tel"
id="phone"
name="phone"
class="form-control form-control-input"
required
placeholder="<?= ucfirst(\S::lang('telefon')); ?>"
value="<?= htmlspecialchars($address_current['phone']); ?>"
pattern="[0-9]{9}">
</div>
</div> </div>
<div class="form-group"> <div class="form-group">
<div class="row"> <div class="row">
@@ -95,8 +109,26 @@
<? if ( $this -> client ):?></div><? endif;?> <? if ( $this -> client ):?></div><? endif;?>
</div> </div>
<script class="footer"> <script class="footer">
$( function() $(document).ready(function () {
{ function validatePhone() {
var phone = $('#phone');
var phonePattern = /^[0-9]{9}$/;
if (!phone.val() || !phonePattern.test(phone.val())) {
$('#order-send').prop('disabled', true);
} else {
$('#order-send').prop('disabled', false);
}
}
$('#phone').on('input', function () {
validatePhone();
});
validatePhone();
});
$( function() {
$( 'body' ).on( click_event, '.addresses .address .btn-select', function(e) $( 'body' ).on( click_event, '.addresses .address .btn-select', function(e)
{ {
e.preventDefault(); e.preventDefault();