0

I am using jQuery validate (bassitance) to validate a large form. A hand full of text boxes then an ever growing list of checkboxes (4600 at last count). I am using the

ignore: 'input[type="checkbox"]'

method but it isn't enough. I still get the 'Stop running this script' error when submitting using IE8 or below. Firefox, Safari, Opera and IE9 are fine.

Is there something I am missing or a better way to do this?

5
  • Are you sure you aren't iterating over all of the elements before doing the validation with ignore? Commented Jan 31, 2012 at 15:41
  • I have a script counting selected boxes via onload. Removed that and still get the same result. Commented Jan 31, 2012 at 16:10
  • Use the Firebug JS profiler and see what slows it all down. Chances are your DOM is simply too big. I agree with the answer suggesting splitting it over over multiple pages with AJAX. Commented Jan 31, 2012 at 16:12
  • Profiler doesn't help much. Firefox has no problem with the page. As much as I don't want the answer to be a IE DOM issue, I am sure it probably is. Commented Jan 31, 2012 at 16:21
  • Perhaps you could make two forms and only validate the one with the text boxes, then in the validation submitHandler, get all the data out of the other form with all the checkboxes? Commented Jan 31, 2012 at 20:02

2 Answers 2

3

Not having 4600 text boxes would be a good start. Do you really need that many on one page? Could you look into paging your data to reduce the amount loaded into the DOM at once?

Sign up to request clarification or add additional context in comments.

3 Comments

Unfortunately the client wants all items listed on a single page. They are broken down into alphabetical groups, but that doesn't help the DOM situation.
Ah, clients/bosses always know best(!). Could you update your original post to include your validation tests? Have you tried stripping them back to just one simple test (for example) to see whether it's just a slow rule you're using?
There are 8 required fields. Then min on a field that is incremented/decremented when one of the checkboxes is clicked. There just isn't that much to this form except for too many checkboxes.
1

I agree with akiller, it's too much elements for one page. Decrease number of elements in your form. But, if you need huge amount of elements to be checked, you must split this form for several web pages, maybe, using Ajax for navigating pages. As alternative, do not use jQuery, it possibly will speed up your script.

1 Comment

I'm looking at doing just that and handling the validation myself instead of using bassitance. But I was hoping someone had the magic bullet.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.