Jump to content

Recommended Posts

Posted

Olá gostaria de ajuda a enviar os valores do Select Right para a página teste1.php

Está dentro do form parece-me tudo normal, tentei enviar como array SelectRight[] mas assim o jquery arrebenta. Alguem têm alguma solução para fazer chegar estes valores por post há página destino?

código:javascript




   $(function() {
       $("#MoveRight,#MoveLeft").click(function(event) {
           var id = $(event.target).attr("id");
           var selectFrom = id == "MoveRight" ? "#SelectLeft" : "#SelectRight";
           var moveTo = id == "MoveRight" ? "#SelectRight" : "#SelectLeft";

           var selectedItems = $(selectFrom + " :selected").toArray();
           $(moveTo).append(selectedItems);


       });
   });


codigo html



<form name="uploadFile" id="uploadFile" method="POST" action="Alimentacao/teste1.php" enctype="multipart/form-data"  target="upload_target" >


<table border="0">
           <tr>
<td align="right"><span for="name" class="legendaForm"></span></td>
               <td colspan="3"><div id="not"></div></td>
</tr>
<tr>



<td align="right"><span for="name" class="legendaForm">* Nome:</span></td>
               <td colspan="3"> <div id="name"></div><input class="vazioForm" type="text" id="nome" name="nome" size="43" /></td>
</tr>


<?php 
$queryCat = $minhaAlim->executarSQL("SELECT idAlim, nomeAlim
                                                                       FROM alimento
                                                                       ");

?>

<tr>
<td  align="right"><span for="descricao" class="legendaForm"> Alimentos a Selecionar:</span></td>

<div class="styled-select">


<select id="SelectLeft" multiple="multiple"> 
 <?while($resultCat = mysql_fetch_assoc($queryCat)){?>  
<option value="1"><?php echo utf8_encode($resultCat['nomeAlim']) ?></option>
<?}?>  
 </select>

<input id="MoveRight" type="button" value=" >> " />
<input id="MoveLeft" type="button" value=" << " />


<select id="SelectRight" multiple="multiple" >


 </select>
</div> 

</tr> 
</form>
Posted

Outra coisa.

Esquece o HTML3.2... Esquece mesmo! Faz como se nunca tivesse existido. Usa o HTML4 strict ou o HTML5.

"[Os jovens da actual geração]não lêem porque não envolve um telecomando que dê para mirar e atirar, não falam porque a trapalhice é rainha e o calão é rei" autor: thoga31

Life is a genetically transmitted disease, induced by sex, with death rate of 100%.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.