I have preloaded hidden fields on the web form. these hidden fields are sent successfully to the controller when the jquery button is clicked
<input type ="hidden" class="serviceslist " value="1"/>
<input type ="hidden" class="serviceslist " value="2"/>
i am adding additional hidden fields by clicking the addmore button. these hidden fields are not be send to the controller when the jquery button is clicked . what might be the problem? are they not present in the dom?
<input type ="hidden" class="serviceslist " value="3"/>
<input type ="hidden" class="serviceslist " value="4"/>
$('#addmoreservices').on('click', function () {
var url = "/Quotation/AddmoreServices/";
var serviceslist = $(".serviceslist ").serialize();
$.ajax({
url: url,
data: { serviceslist: serviceslist },
cache: false,
contenttype: 'application/json',
dataType: "json",
type: "GET",
success: function (data) {
return false;
},
error: function (reponse) {
alert("error : " + reponse);
}
this is the code of the button i am trying to send whole bunch of hidden fields(preloaded and created) to the controller. the preloaded are being sent and created ones are left behind)