Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- http://forum.imasters.com.br/topic/524065-receber-no-post-valores-de-duas-listbox/
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Usuario</title>
- <meta name="" content="" />
- <script language="JavaScript">
- function move(src, dst){
- MenuDestino = document.getElementById(dst);
- MenuOrigem = document.getElementById(src);
- var arrMenuOrigem = new Array();
- var arrMenuDestino = new Array();
- var arrLookup = new Array();
- var i;
- for (i = 0; i < MenuDestino.options.length; i++){
- arrLookup[MenuDestino.options[i].text] = MenuDestino.options[i].value;
- arrMenuDestino[i] = MenuDestino.options[i].text;
- }
- var fLength = 0;
- var tLength = arrMenuDestino.length;
- for(i = 0; i < MenuOrigem.options.length; i++){
- arrLookup[MenuOrigem.options[i].text] = MenuOrigem.options[i].value;
- if (MenuOrigem.options[i].selected && MenuOrigem.options[i].value != ""){
- arrMenuDestino[tLength] = MenuOrigem.options[i].text;
- tLength++;
- }
- else{
- arrMenuOrigem[fLength] = MenuOrigem.options[i].text;
- fLength++;
- }
- }
- arrMenuOrigem.sort();
- arrMenuDestino.sort();
- MenuOrigem.length = 0;
- MenuDestino.length = 0;
- var c;
- for(c = 0; c < arrMenuOrigem.length; c++){
- var no = new Option();
- no.value = arrLookup[arrMenuOrigem[c]];
- no.text = arrMenuOrigem[c];
- MenuOrigem[c] = no;
- }
- for(c = 0; c < arrMenuDestino.length; c++){
- var no = new Option();
- no.selected = true;
- no.value = arrLookup[arrMenuDestino[c]];
- no.text = arrMenuDestino[c];
- MenuDestino[c] = no;
- }
- }
- </script>
- </head>
- <body class="ex_highlight_row">
- <form name="combo_box" action="logado.php" method="post">
- <center>Nome:<input type="text" name="nome" size="15" /></center>
- <table>
- <tr><td>Selecione os Bairros</td><td></td><td>Bairros Selecionados</td><tr>
- <tr>
- <td>
- <select multiple size="10" name="list1" id="list1" style="width:150">
- <option value="value1">value1</option>
- <option value="value2">value2</option>
- </select>
- </td>
- <td align="center" valign="middle">
- <input type="button" onClick="move('list2','list1')" value="<<">
- <input type="button" onClick="move('list1','list2')" value=">>">
- </td>
- <td>
- <select multiple size="10" name="list2[]" id="list2" style="width:150px">
- </select>
- </td>
- </tr>
- </table>
- <table>
- <br /><br /><br />
- <tr><td>Selecione os Empacotador</td><td></td><td>Empacotador Selecionados</td><tr>
- <tr>
- <td>
- <select multiple size="10" name="list3" id="list3" style="width:150">
- <option value="value1">value1</option>
- <option value="value2">value2</option>
- </select>
- </td>
- <td align="center" valign="middle">
- <input type="button" onClick="move('list4','list3')" value="<<">
- <input type="button" onClick="move('list3','list4')" value=">>">
- </td>
- <td>
- <select multiple size="10" name="list4[]" id="list4" style="width:150px">
- </select>
- </td>
- </tr>
- </table>
- <input type="submit" value="cadastrar" />
- </form>
- <p><a href="index.php" class="button">voltar</a></p><br /><br />
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement