Allow (+) sign in email validation

25.09.2021 20:59
#1
jabo74
Joomshopping forum user no avatar
Name: jabo74
25.09.2021
Posts: 1
Quote
Allow (+) sign in email validation

Hi
some users have email addresses with a + (plus) sign in the middle, e.g. john+doe@example.com.

Joomshoping does not allow you to register an account with such an email address. Please tell me where to change it


Joomla: 3,9,10
 
25.09.2021 22:15
#2
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25936
Quote
Aw: Allow (+) sign in email validation

components\com_jshopping\js\validateForm.js

var pattern = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

change to

var pattern = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-\+])+\.)+([a-zA-Z0-9]{2,4})+$/;

 
12.07.2022 16:52
#3
energoura
User energoura
Name: uri
15.11.2012
Posts: 98
Quote
Aw: Allow (+) sign in email validation

в Joomshopping 5.0.5 такого файла нет.
Проверка полей не работает совсем.
как исправить ?

+ вопрос:
Joomshopping Addons: Telegram/Viber orders annonce - совместимость Joomla: 4 и JoomShopping: 5 + будет обновление ?


Last change: 12.07.2022 17:04
 
12.07.2022 21:08
#4
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25936
Quote
Aw: Allow (+) sign in email validation

-Проверка полей не работает совсем.
Используется стандартая html проверка.

Telegram/Viber orders annonce - Будет позже для JoomShopping 5.


Last change: 12.07.2022 21:09
 
14.07.2022 09:18
#5
energoura
User energoura
Name: uri
15.11.2012
Posts: 98
Quote
Aw: Allow (+) sign in email validation

-Проверка полей не работает совсем.
Используется стандартая html проверка.

В поле телефон / мобильный телефон сейчас можно вводить любые символы. Это очень плохо. Нужно что бы клиент мог вводить только цифры. ну или +380.......
как это сделать ?

 
14.07.2022 15:08
#6
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25936
Quote
Aw: Allow (+) sign in email validation

components\com_jshopping\templates\default\checkout\adress.php

меняйте
<input type="text" name="phone" id="phone" value="<?php print $this->user->phone?>" class="input form-control <?php if ($config_fields['phone']['require']):?>required<?php endif?>">

на

<input type="text" pattern="\+380\d+" placeholder="+380" name="phone" id="phone" value="<?php print $this->user->phone?>" class="input form-control <?php if ($config_fields['phone']['require']):?>required<?php endif?>">

или

<input type="text" pattern="\d+" name="phone" id="phone" value="<?php print $this->user->phone?>" class="input form-control <?php if ($config_fields['phone']['require']):?>required<?php endif?>">

 
14.07.2022 19:42
#7
energoura
User energoura
Name: uri
15.11.2012
Posts: 98
Quote
Aw: Allow (+) sign in email validation

как только меняю код на ваш или любой другой то при отправке формы появляется надпись: "Please enter mobil"
Aw: Allow (+) sign in email validation
____________________12.png

 
14.07.2022 21:47
#8
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25936
Quote
Aw: Allow (+) sign in email validation

Вы изменили названия поля.

Просто добавте
pattern="\+380\d+" placeholder="+380" к вашему полю


Last change: 14.07.2022 21:49
 
15.07.2022 14:27
#9
energoura
User energoura
Name: uri
15.11.2012
Posts: 98
Quote
Aw: Allow (+) sign in email validation

название не менял а просто скопировал не заметив что вы даете пример для name="phone" а я редактирую у себя name="mobil_phone". с этим розобрался.

для себя пока сделал так:
<input type="tel" name="mobil_phone" id="mobil_phone" onkeyup="this.value = this.value.replace(/[^\d\+]/g,'');" maxlength="13" pattern="\+380\d+" placeholder="+380" autocomplete="on" value="+380<?php print $this->user->d_mobil_phone?>" class="input form-control <?php if ($config_fields['mobil_phone']['require']):?>required<?php endif?>">


может что лишнее поставил то поправьте

сейчас пытаюсь найти решение чтобы value="+380" сделать не удаляемым и что бы его нельзя было изменить в поле ввода.

есть вот такой скрипт:
<script>
document.getElementById('mobil_phone').addEventListener('input', function(){
this.value = "+380" + this.value.slice(4);
});
</script>
но хотелось бы обойтись без него.
может кто подсказать как это можно реализовать ?


Last change: 15.07.2022 14:28
 
23.07.2022 10:46
#10
admin
(Support Team)
User admin
Name: Admin
05.08.2010
Posts: 25936
Quote
Aw: Allow (+) sign in email validation

New version
Telegram/Viber orders annonce 2.3.2 (JoomShopping 5.0.0+)

 


Copyrights MAXXmarketing GmbH. Alle Rechte vorbehalten
Durch die Nutzung dieser Website stimme ich zu, dass Cookies zur optimalen Gestaltung der Website sowie zur Analyse der Nutzung der Website verwendet werden. Weiterführende Informationen finden Sie hier. OK, einverstanden.