Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Events not always firing
01-30-2013, 07:00 PM #1
- Join Date
- Mar 2012
- Thanked 0 Times in 0 Posts
Events not always firing
I'm not really sure how to go with this, but here goes:
If it's a straight-forward HTML element then everything works fine. E.g. a <select> element fires on change.
However, if I use a jQuery script (e.g. a jQuery colour selector), then although that jQuery script populates an <input> field, the validation script doesn't fire.
This I suppose is obvious as you don't click, blur, change it, it's just the jQuery script changing it.
Another example is a rating script (rate out of 5). It uses radio buttons as a non-jQuery fallback and the jQuery script just hides those radios (with CSS), displays the star images and then changes the radios when the user interacts with the star images. That way the server handles a form submit the same way regardless of the availability of jQuery. However, the validation script doesn't fire.
01-31-2013, 03:23 PM #2
- Join Date
- Jan 2011
- Thanked 548 Times in 547 Posts
Code makes everything a lot easier. Jquery needs a trigger just like form element validation. Why not just add the JQ in the validation function? I really don't think you need to use jq just to change the back ground color of an element, but I'm guessing without your code. Please post it.