Php phone validation doesn't work -


i'm working prestashop 1.6, i'm not php, wanted make 1 change in website look. in default have 2 phone inputs: home , mobile. looks that:

<div style="display: none" class="form-group is_customer_param">                     <label for="phone">{l s='home phone'}{if isset($one_phone_at_least) && $one_phone_at_least} <sup>**</sup>{/if}</label>                     <input type="text" class="text form-control validate" name="phone" id="phone" data-validate="isphonenumber" value="{if isset($guestinformations) && isset($guestinformations.phone) && $guestinformations.phone}{$guestinformations.phone}{/if}" />                 </div>                 <div class="{if isset($one_phone_at_least) && $one_phone_at_least}required {/if}form-group">                     <label for="phone_mobile">{l s='mobile phone'}{if isset($one_phone_at_least) && $one_phone_at_least} <sup>*</sup>{/if}</label>                     <input type="text" class="text form-control validate" name="phone_mobile" id="phone_mobile" data-validate="isphonenumber" value="{if isset($guestinformations) && isset($guestinformations.phone_mobile) && $guestinformations.phone_mobile}{$guestinformations.phone_mobile}{/if}" />                 </div>                 {if isset($one_phone_at_least) && $one_phone_at_least}                     {assign var="atleastoneexists" value=true}                     <p class="inline-infos required">* podaj nr telefonu</p>                 {/if} 

i've made first 1 not visible, because thought 1 filled field enough. , seems be. can submit form without entering mobile phone number. can see maybe problem here? or maybe how can make working?

example of field works good, required , not paired field:

    <div class="required form-group">                         <label for="lastname_invoice">{l s='last name'} <sup>*</sup></label>                         <input type="text" class="form-control validate" id="lastname_invoice" name="lastname_invoice" data-validate="isname" value="{if isset($guestinformations) && isset($guestinformations.lastname_invoice) && $guestinformations.lastname_invoice}{$guestinformations.lastname_invoice}{/if}" />                     </div> 

i've tried validate mobile way:

<div class="required phone_mobile form-group">                     <label for="phone_mobile">{l s='mobile phone'} <sup>*</sup></label>                     <input type="text" class="text form-control validate" name="phone_mobile" id="phone_mobile" data-validate="isphonenumber" value="{if isset($guestinformations) && isset($guestinformations.phone_mobile) && $guestinformations.phone_mobile}{$guestinformations.phone_mobile}{/if}" />                 </div> 

but without success...

it looks $one_phone_at_least variable not set true. back-office, go preferences > customers , make sure "phone number mandatory" turned on. should fix it.

by way, required class should used on input, not form-group container. if made 1 change, have prevented user submitting form, if worked around send data without phone number, server allow it. following steps in first paragraph, server demand phone number set.


Comments