I get form input elements as follow using jquery for further processing.
var ctrls = $('#frmUserMst').serializeArray();
Occasionally i need to add some extra info into this ctrl Array. How do i do this as
it does not support push() or add() method.
This is a requirement in VS2008 MVC2 project.
Further info:
As disabled controls are not populated in the serializeArray() output, i need to add them manualy.
Any help is appreciated.
.serializeArrayoutputs an array of objects. Each object has two keys:nameandvalue.namerepresents the input name, andvaluerepresents the input value. Therefore, you can add another item to the array by adding another object to the array that matches the other objects.The input doesn’t have to exist for you to add a value to that array.