I'm trying to add an array to my form submit action. Please note I do not want to use ajax..just a regular submit after adding this "uids" parameter.
$("#new_meeting").live("submit", function(){
var uids = [];
$("span.receiver-name").each(function(){
var uid_name = $(this).attr("id");
var uid = uid_name.split("--")[0];
uids.push(uid);
})
$("#new_meeting").append("&uids=" + uids);
});
This is not working since on the server side I'm not seeing the uids parameter. There is also another thing I tried looking at other posts on stackoverflow but couldn't get that to work either..here is that..
var input = $("<input>").attr("type", "hidden").attr("uids", "mydata").val(uids);
$('#new_meeting').append($(input));
Has anyone done this? Thanks.
I'll give a shot before markup,
Change this
$("#new_meeting").append("&uids=" + uids);
to
var input = $("<input>").attr({"type":"hidden","name":"uids"}).val(uids);
$('#new_meeting').append(input);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With