I have the following image below
andeachcheckboxcorrespondstothevalue
<inputtype="checkbox" value="3" class="serie2" id="serie2[3]" name="serie2[3]">
<input type="checkbox" value="4" class="serie2" id="serie2[4]" name="serie2[4]">
<input type="checkbox" value="5" class="serie2" id="serie2[5]" name="serie2[5]">
successively ... from php:
echo "<label><i><input type='checkbox' name='serie2[$lnSer[ser_cod]]' id='serie2[$lnSer[ser_cod]]' class='serie2' value='$lnSer[ser_cod]' $marca>$lnSer[ser_descr]</i></label>";
Next, if in my Ajax function I set the variable like this: var serial = '5,17,14'; ok, more when I try to go using the function below, the problem occurs:
var serie = [];
$(".serie2:checked").each(function() {
serie.push(this.value);
});
How do I get the value in the format var var = '5,17,14'?
IfIsetthevalueasvarcourse='I|25|TU-II|2|TU';Pass!
HowdoIgetthevalueofthevalueofthisfield,gettingthatformatcourse='I|25|TU-II|2|TU'
<optionvalue="3|1|2">CICLOS E PRÁTICAS DOCENTES | Turma 2 | </option>
<option value="3|1|5">CICLOS E PRÁTICAS DOCENTES | Turma 5 | </option>
Thank you