javascript events - asp.net mvc: checkbox onchange not working -
I have a page with a set of checkboxes, that when I make any changes, I start a JavaScript function Although I have three problems with the checkbox:
-
My On Change Event only runs "Sometimes" The focus must be changed between different checkbox controls
-
When it runs it, it is returning the result of the previous checkbox (no
-
-
& lt;% = Html.CheckBox ("sl-" + row.Id, value, new {onChange = "utility check (" + row.Id + "," + key + ")"})%>
JavaScript
function utility check (provider id, parent records id ) {Var params = {}; params.providerId = providerId; params.parentRecordId = p arentRecordId; var value = $ ("# sl-" + providerId) .val (); Params.value = value; $ .getJSON ("Suitability check", params, blank); }; Browsers are funny about radio buttons and check boxes and can delay changes until the focus is changed.
It may be that some of the jQuery Live (unchecked, from the top of my head) use:
$ (': checkbox'). Live ('click', function () {$ (this) .change ();});
Comments
Post a Comment