3
Hello. I have the following code:
<select id="idselect" class="ui-corner-all ui-widget-content" multiple="multiple" name="idPosto" style="padding: 3px 4px;">
<option value="1"></option>
<option value="2"></option>
<option value="3"></option>
<option value="4"></option>
</select>
I need every click the customer makes on an option to href
of the link the "idselect[]"+valorclicado
.
<a href="selecionados.php?precisoqueconcateneaqui"></a>
Assuming the client selects option 2 and 3 the link it would form:
meusite.com/selecionados.php?idselect[]=2&idselect[]=3
I prefer it to be with pure javascript, but if you know some way with jQuery it will also help a lot.
@maicon_carraro , this code solved 80% of my problem, see why it didn’t solve 100%: my urltesto looks like this: var urlText = 'lista_cadastrados.php? codapprove='; In "codapprove=" I need to pass a $user->getCodigo that comes dynamically from PHP, see the page to better understand: http://www.alexandrelima.net.br/internship I need some form to also send getCodigo inside the function and also concatenate together.
– Alexandre Lima
@Alexandrelima you can create an input
hidden
with the value ofcodAprovar
? Then it’s easy to stay 100% :)– Maicon Carraro
that there after the
for
you puturlTexto += "codaprovar=" + document.getElementById('seuinputHidden').value;
– Maicon Carraro