如果两个不同的选择下降的数值相同,如果它们有相同的“名称”,然后将总价值归入使用舱位的阵列,那么我如何能够在选择(不提交)时将这两个数值加在一起?
EDIT
For a little clarification, I am dynamically creating the list which needs to look like this
BOX A, BOX A, TITLE
BOX B, BOX B, TITLE
BOX C, BOX C, TITLE etc...
每个清单都有所不同,很少相同。 随后,这些箱子可以是DE或F。 选定(目前为交换) 如果价值不是空的,那么所有相应的箱子都需要加在一起,然后被推入一个适当的阵列。
var s=[sumOfAs, sumOfBs, sumOfCs];
I hope this helps... Also the back end is PHP THANKS!
EDIT
这里是把第一套价值观推向一阵的支架。
$("#selectionBox select").change(function(){
s = [];
$("#selectionBox select option:selected").each(function(){
$("#selected_songs").text( );
var v = $(this).val();
if(v != ){
s.push(v);
}
if(s != ""){
$( #selectionButton ).show();
var mw = $("#list_month_New").val();
var dw = $("#list_day_New").val();
var yw = $("#list_year_New").val();
var t = $("#listTitle").val();
if(mw == "" || dw == "" || yw == ""){
$("#songListWarning").show();
}else{
$("#songListWarning").hide();
}
}else{
$("#list_month_New").val();
$("#list_day_New").val();
$("#list_year_New").val();
$("#listTitle").val();
$( #selectionButton ).hide();
}
});
s.sort();
jQuery.each(s, function(){
O = "";
O = this+"<br />";
str = /&(.+)/.exec(O)[1];
num = O.replace(/-.*/, );
fullString = <span style="color:black"> +num+ </span> - +str;
$("#selected_songs").append(fullString);
});
I just need to figure out how to add another value to the initial value?