joaorr1 Posted October 11, 2012 at 03:11 PM Report #478720 Posted October 11, 2012 at 03:11 PM 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>
taviroquai Posted October 11, 2012 at 08:27 PM Report #478783 Posted October 11, 2012 at 08:27 PM Viva, O HTML não está muito bem... não podes ter coisas do tipo <table><tr><td></td></tr><div><select></select></div></table>... De qualquer forma, podes enviar o formulário colocando um botão <button type="submit">Enviar</button> antes do </form> Ou então, podes enviar por ajax com jQuery com http://api.jquery.com/submit/ e http://docs.jquery.com/Ajax/serialize
brunoais Posted October 11, 2012 at 09:51 PM Report #478802 Posted October 11, 2012 at 09:51 PM 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%.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now