jQuery validation, how to auto clear error messages of hidden fields? - jquery-validate

The jquery validate plugin auto removes error messages of visible fields when a value is entered, i have one hidden field populated by custom events whose error messages do not auto clear when the value is set. What would be a clean way to achieve this?
Thanks in advance for your help,

OK, should anyone be interested in how to do this here is a simple way:
$('.error:contains("here goes the text of the error message you want to remove")').remove();

Related

how to display validation errors on submit with Formik?

Very weird thing that Formik seems to be so famous but I can't find this very simple functionnality.
Lets say the user try to send the form with an empty field, how can I display the errors ? I can display them once the field is touched but not once the form has been sent (and obviously I don't want to display the errors right away, for example an empty field)
The actual behavior is that the submit function is not called if the validation fails, seems right but what about error display ? It seems there is no simple way to do this (I found a few kinda heavy work around with some callbacks and handler components but what's the point using a form library then...)
So maybe I have missed something please tell me
Any idea how to display the validation errors when submitting the form ?

What is the right way to do validation in RactiveJS app

I have several inputs and a button. I want to do something on button click, but before I need to validate inputed data. If data is incorrect, app should highlight inputs and show a message.
What is "canonical" way to do it?
Short answer: there's no convention.
You can roll with any validation library you choose, so as long as you can hook it up, show invalid input errors, as well as prevent the form from submitting if the form is invalid.

Salesforce - Make all fields read-only

I am trying to figure out the best way to make all fields in a custom object read only after a condition is met.
For example. There is a field called Status. If the status is equal to Closed, I want all fields on this custom object to be readonly i.e non editable.
What is the best way to do this? Validation rule, trigger, etc? I would really appreciate examples. Thanks
In short: With a workflow you could change the record type, for that record type you can assign a page layout which is read only.
Add a trigger to the custom object
Open custom object, click on the "Field Label" of one Custom Field, when it opens, create a new "Validation Rule" that checks the status and displays an error message

Clearing one form in ajax, without clearing the other

Have a chat room, issue is, is that when you submit something, the message in the form box stays. What I want, is for when it is submitted using the button, the message one clears.
So, I added $('#mbody').val(''); and added the id mbody to the form with the message in it. But for some reason, it clears the other form.
You don't need to change the non-existant value of the FORM (form inputs have values). You simply need to reset it.
var form = document.getElementById('mbody');
form.reset();
Make sure each form has a unique id.
I'll see your vague question lacking example code and raise you a vague answer. ID's need to be unique - you likely have duplicate ID's or are referencing the incorrect ID.

How to trigger input's property required on HTML5?

My question is about how can I trigger the validation of required property without using the submit button
More or less I big a huge form, that is divide by a slider(steps), but is just one form. The point is, that form implement ajax at the end to submit the information that is serialize manually with javascript. So the problem is that the required (attribute, property) is not working, so you have to make the rule for empty input manually. I think is a waste, if you can do that with required.
So I want to bind every slide, to the required inputs.
Thank you in advance
Have you tried checkValidity() ( http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#dom-cva-checkvalidatity )?

Resources