asp.net mvc 2 - Passing multiple checkbox values to action with Jquery -
I have a problem that is driving me sitting.
I have a page that generates on the basis of search, a list of checkboxes within the page is also a dialog box that is designed to suppress a button. What I'm trying to do is get the value from the checkbox and pass them into a controller action which then partially gives the dialog.
The problem I am experiencing is that I am getting the value from the checkbox, but they are going to take action in the controller. Not sure what I'm missing.
I'm using jquery script
var create_dialog = jQuery ("# main div # list_dialog"); // AddToList is a button to send the values of $ $ ("# AddToList"). Live ("click", function () {var myData = new Array (); var i = 0; $ ("Input: checkbox [@ (name = 'id']"). Each (function () (if ( It.check) {myData [i] = this.value; i ++;}}); create_dialog.load (Jurat.Path.createActionPath ("list", "list value"), {id: myadata}, function ( ) {Create_dialog.dialog ("open"); create_dialog.find ("form"). Validate ();});});
Controller function
[HTTP post] Public Action List Price (String ID) {// Deleted Manipulation Details by Partial View ("List Selection", Data) ;}
What I'm going to do with jQuery stuff I'm not 100% sure and create_dialog but I think that you are passing an array to the controller, while the controller is just looking for a string.
I think you need to change the controller Will be:
[HTTP post] Public Action Result List Value (string [] id) {// Deleted Hermitage Viv O return a partial view ( "Select List", data); }
Comments
Post a Comment