jquery - Retrieve Check box from array they stored in -


i have function , want create function retrieve check box array (user_card_declare_data_list) on model again

userobj.savedeclarationform = function () {     var user_card_declare_data_list = []     $(".option").map(function () {         var user_card_declare_data = {}         if ($(this).find(".result_val")[0].checked == true) {             user_card_declare_data.result_val = 1;         }         else {             user_card_declare_data.result_val = 0;         }         user_card_declare_data_list.push(user_card_declare_data);     })     $('#mymodal').modal('hide');     userobj.declaration = user_card_declare_data_list; } 

change

var user_card_declare_data_list = [] 

to:

var user_card_declare_data_list = this.user_card_declare_data_list = [] 

now can access array in other methods of userobj with:

this.user_card_declare_data_list 

Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -