PHP - select multiples

 
Vista:

select multiples

Publicado por Maria (30 intervenciones) el 21/08/2011 17:36:41
Hola
Tengo unos select multiples donde en el primero seleciono unas opciones que van a parar al segundo. Eso me funciona pero no me funsiona a subir a la bbdd mediante el formulario. He intentado con un hidden con el nombre del segundo select pero asi dejan de funcionar. este es el codigo.

<script>function copyToList(from,to)
{ fromList = eval('document.registro.' + from); toList = eval('document.registro.' + to); if (toList.options.length > 0 && toList.options[0].value == 'temp') { toList.options.length = 0; } var sel = false; for (i=0;i<fromList.options.length;i++) { var current = fromList.options[i]; if (current.selected) { sel = true; txt = current.text; val = current.value; toList.options[toList.length] = new Option(txt,val); fromList.options[i] = null; i--; } } if (!sel) alert('Debes seleccionar algún elemento...');
}
function SelectAll(from,to) { List = eval('document.registro.' + from); Dest = eval('document.registro.' + to); ret = ''; for (i=0;i<List.length;i++) { ret += List.options[i].value + ','; } Dest.value = ret.substr(0, ret.length-1);
}
</script>

<select name="list_idiomas[]" id="list_idiomas" style="width:200px" size="5" multiple="multiple">

<option value="1">Latin</option>
<option value="2">Ingles</option>
<option value="3">Griego</option>

</select></td>
<td><input name="add" id="add" value="&gt;&gt;" onclick="copyToList('list_idiomas','sel_idiomas')" type="button" /><br />
<input name="sub" id="sub" value="&lt;&lt;" onclick="copyToList('sel_idiomas','list_idiomas')" type="button" /> </td>
<td><select name="sel_idiomas[]" id="sel_idiomas" style="width:210px" size="5" multiple="multiple">
</select>


Tambien que tipo de type tengo que poner en la bbdd?

Gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder