Sorry, i have been working with wappler for a year but i am new to the forum.
I’m not sure to which address I can send my request to get an answer.
I want to force the user to enter a phone or mobile number. If he fills out both, that’s okay, if he doesn’t fill out either, an error message has to appear.
I’m already using the client-side validation, but the server-side validation not often.
I suppose I have to “build” something on the server side based on the conditions so that I can check if one of the two fields has been filled out, and if not, it returns an error message.
Sorry I suppose I haven’t explained exactly what is my problem. I know the normal Validations-Steps and Patterns. So, I try to ask my question differently:
I have a registration form: name, e-mail validated against the database and so on. There are fields which I set to requested in the validation options, the requested format (email, numbers) and so on.
In Switzerland not everyone has a telephone connection anymore but a mobile number. So, I want to ensure that one of both fields has been filed out the phone number or the mobile number.
So, if I set both to required, I have to explain in the text that he should copy his phone number into both fields or the form won’t pass the validation.
So is there a possibility to validate that one of both fields has information in there and if yes to save the information to the database and if not that the user gets a message that one of both numbers have to be filled in.
I have still activated the required options on both fields. I have added (first one the one and then on both fields the !inp_xxx.value option). But both fields are still required and complaining when fill out only one of them.
I attach my code perhaps you’ll see if I really have done what you have recommended to me to do.
Thanks
Telefon
<input type=“tel” class=“form-control form-control-sm” id=“inp_Telefonnummermain” name=“Telefonnummermain” aria-describedby=“inp_Telefonnummermain_help” placeholder=“Ihre Telefonnummer oder Ihre Natelnummer”
required="!inp_Natellnummermain.value" data-msg-required=“Geben Sie bitte Ihre Telefonnummer oder die Handy-Nummer ein!” autocomplete=“off”>
Natel
<input type=“tel” class=“form-control form-control-sm” id=“inp_Natellnummermain” name=“Natellnummermain” aria-describedby=“inp_Natellnummermain_help” placeholder=“nochmals Ihre Natelnummer”
required="!inp_Telefonnummermain.value" data-msg-required=“Geben Sie bitte Ihre Telefonnummer oder die Handy-Nummer ein!” autocomplete=“off”>