Ich arbeite mit Prestashop 1.6, ich bin nicht wirklich in PHP, aber ich wollte 1 Änderung in der Website aussehen. Standardmäßig habe ich 2 Telefoneingaben: für zuhause und mobil. Es sieht wie folgt aus:Php Telefon Validierung funktioniert nicht
<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}
ich nicht sichtbar gemacht haben erste, weil ich dachte, dass ein gefüllt Feld genug sein. Und es scheint so zu sein. Aber ich kann ein Formular senden, ohne die Handynummer einzugeben. Kannst du sehen, wo das Problem ist? Oder vielleicht, wie kann ich es zum Laufen bringen?
Beispiel für Fläche, die gut funktioniert, ist wirklich erforderlich und nicht mit einem anderen Feld gepaart:
<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>
ich mobil auf diese Weise zu bestätigen habe versucht:
<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>
aber ohne Erfolg .. .
ist das Standard-Kontaktformular? –