I have a variety of forms on a site. I would like to be able to set different error classes for different forms, as they will need different treatment.
I have a form that I am validating where I set the error classes I want to show up like so:
I think the validate plugin removes labels with the errorClass specified in the default (or in defaults you set using jQuery.validator.setDefaults). But it doesn't look like the plugin will remove the error if you set it for that individual form as I did. Anyone come across this and can advise me on what I need to do?
I am attempting to use focusCleanup to try and resolve the flickering error issue when using the remote method. focusCleanup works just fine on my forms that have errors inline with the form fields, but if I use errorContainer:
... These errors do not disappear when the user focuses on one of the inputs that has an error associated with it. I don't think this is supposed to be how it works, is this a bug? Or do I need to do something extra for errors placed inside containers?
I have seen numerous posts about this but can't sift out the current "accepted" solution to this problem.
I am struggling with the validate plugin's remote method. I'm on version 1.6 of the plugin. My problem is with the timing of the remote method. In firefox, when I first type in a name inside a text field that has the remote method it will only validate once I click to submit. This is all fine, except the way I handle if the entries are valid on the form is I use
if $(".something").valid(){ blah blah blah };
... one of the blah's being that I close the modal window that the form lives on. Because of the time the remote method takes, the validator appears to initially, for 200ms, think the form is valid, and will close my modal, but never submit. I considered, instead, setting a variable to "valid" and placing only that inside "blah blah blah" and then testing that variable for valid or invalid before closing the modal, but that feels quite hacky.
Similarly, IE6 struggles with the remote method. while I can see firefox aborting tons and tons of the remote requests and not doing any of the error display stuff, IE doesn't really "abort" and go by the latest request. IE just keeps flickering the error message on and off and on and off as I type, presumeably because it just can't keep up. On occasion, the error message sticks, even if the entry is valid.
Can someone recommend a way for me to make remote a bit more agreeable? Can I restrict remote to only work on submit, regardless if a previous entry had been incorrect? Anyone else have any advice for dealing with the time it takes for the remote to validate? Thanks!!
So there is a decent number of this same question on this forum, but either without solutions or with solutions that I'm just not sure if its that great... I would love if someone could help me out with this and hopefully we can get this thread to be a good reference point for all those others.
I have a small, two input form that is being loaded when the user clicks on a link. This form is loaded via ajax. It does not initially exist, only a div exists in its place, ready to have the form loaded there.
The inputs have classes to them "title" and "description". In my validation js file, these classes are defined as part of the addClassRules bit. I also have some default messages set ( $.extend($.validator.messages). Both the validation rules and the default messages I have set are working.
But when I try to add specific validation rules/messages for just this form I load...
$("#ajaxloadedform").validate({ blah blah blah })
.... nothing inside this validate works. But if I wanted to test...
$("#ajaxloadedform").valid()
... this does work. I'm assuming, as many others before me have, that its the ajax load issue. But it puzzles me why some parts of it work while other parts do not.
Thanks in advance for any assistance you can offer!
Once again, another question on this plugin. I really hope these questions I'm posting are useful for others out there, can't find this in search, which I'm a bit surprised by.
I have a textarea where the user can choose to enter emails, comma separated.
I know we can validate the email format using the "email" method that's already available. But what I need to do is split the string that the user types, make sure all whitespace is removed, and then I need to validate each piece that was split out individually to make sure they're all okay. If so, return valid on the whole area.
I assume I need to make a method? How can I, inside this, call the base "email" validation for each of the segments I split?
I have a form (of many) that I'm trying to display the error messages for. But the catch is that I don't want all of them to be displaying using the same errorContainer.
Some elements I want to display the way the default is set to display, as a label appended to the invalid element. But there is a block at the bottom that I want it to show all of those elements' errors an an Error container I have set aside for it.
But once I added this container, I saw that other errors in other parts of the form above this were also being put down here, which doesn't flow at all.
Can I specify specific containers for specific parts of the same form? Or placement for specific elements?
Now I need to add a method because I don't believe there is any existing method to do this.
I need to check several different fields in a form to make sure they are not all empty. Two select fields and one text field. Can anyone help me with this? How can i add a method that is for the entire form, which will then look at the specific elements I need it to, to check to make sure all three are not blank?