- This topic has 7 replies, 2 voices, and was last updated 5 years, 2 months ago by
hidroxid. This post has been viewed 1404 times
-
AuthorPosts
-
May 4, 2021 at 8:57 am #10037990
hidroxid
ParticipantHello
Bearing in mind that the input fields can be assigned the property data-msg-required = “Error text” so that when trying to submit the form it is validated, is it possible to execute the alert associated to a particular field from code?
It happens that I have specific validations for some fields and I am evaluating if I can activate an error message similar to the one that is executed when it has the data-msg-required property: the text in red under the field, the red box around it and to be removed when something is typed.
Thanks!!
Template Version: 8.3.0May 4, 2021 at 10:05 pm #10037994Support
KeymasterHello, here’s an example of that:
<div class="form-group col-md-6 has-danger"> <label class="mb-1 text-2">Full Name</label> <input type="text" value="" data-msg-required="Please enter your name." maxlength="100" class="form-control text-3 h-auto py-2 is-invalid" name="name" id="name" required=""> <label id="name-error" class="error" for="name">Please enter your name.</label> </div>
Regards,
Jonas
May 4, 2021 at 11:12 pm #10037997hidroxid
ParticipantHello
Yes, I have already learned from your examples about how to assign the attributes for automatic validation in the fields of a form, thanks any way.
But, the question is:
Can that validation be run from code?
Something like: $(“#name”).ErrorActive() or $(“# name”).ShowValid()
And additionally, how can I show other error information, with the same format that is shown when the validation is activated using the attribute data-msg-required = “Please enter your name.”
My requirement is for the following:
-Field 1 has the attribute data-msg-required = “Please enter your name.” which runs perfectly.
-But, apart from that validation I have another one that I run via Ajax and check that the information exists.
-If it does not exist, I would like to show it in the same space, the same font and with the same format (the red box around the field) but with another message, for example: The information was not found. I can even multiple different validations for the same field.I am looking to standardize the error messages.
I hope they help me understand and help with these inventions 🙂
Thank you.
PS: Is it possible to add extra collaboration for you? I say this because I have received collaboration from you that exceeds what I have paid for your support and sincerely, I know that I am indebted to everything that you have helped me.
May 5, 2021 at 5:28 am #10038000Support
KeymasterThis reply has been marked as private.May 5, 2021 at 6:39 am #10038005hidroxid
ParticipantHello
The code works fine, thanks a lot, but when the input field is part of an input-group with input-group-append it doesn’t work as expected.
Please see the pictures, before and after applying the style.
Thanks!
PS: You don’t accept crypto USDT? If it is negative, I will ask you to manage the payment via PayPal.
May 5, 2021 at 9:00 am #10038009hidroxid
ParticipantPreviously to this answer, i send you other answer related to a pay. Do you receive that?
May 5, 2021 at 9:35 pm #10038012Support
KeymasterThis reply has been marked as private.May 6, 2021 at 6:18 am #10038026hidroxid
ParticipantWork perfect!
Thanks!
-
AuthorPosts
This topic is marked as "RESOLVED" and can not rceive new replies.

