My combo box's short field name is "Category." And it has a class assigned to it named, "target." I want to add an onchange event to the combo box. (not onblur or onclick or down or up)
I followed the link provided by Ryan in this other forum question:
http://www.datasprings.com/products/productforums/view/question/id/34214/dnnmodules/timing-on-the-client-side-events-on-different-devices
to the documentation for the change handler:
http://api.jquery.com/change/
And I have followed the directions but cannot get anything to happen when the combo box is changed. I suspect that my problem is syntax.
It tells me to add the following jquery. I am adding it to the initial javascript section of the form. (is this the right place to add this?)
$( ".target" ).change(function() {
"Handler for .change() called." );
This should be what watches for when the combo box is changed.
Note, I have added the class named, "target" to the combo box field so as to match the way the sample code is identifying the field to watch.
So finally, my question is, why does this not raise an alert when the combo box is changed? Should I be using different syntax for the JQuery change function?
I have tried:
1. $("#Category").change(function() {
2. $("#dnn_ctr5663_DynamicForms_Responses_40d7770f-880b-4af5-ad56-6f5157e441a3").change(function() {
3. $(Category_FieldID).change(function() {
4. And many more different syntax's.
What is the right way to set up this on change event?
Thank you in advance!
|