2
I have this Search/Serialize Jsfiddle, only I didn’t want him to take the name of select
, only the value
of option
and search.
It can "ignore" the name
and use only the value
?
Here’s the code:
var host = "http://www.rs1.com.br/";
$(document).ready(function(){
$('#send').click(function(){
var variables = $('#form').find('campo').serialize();
var destination = host + variables.replace('=','/');
$('#link').html(destination)
window.open(destination);
});
});
<form id="form">
<select>
<option value="tutto-moto" class="campo">Tutto</option>
</select>
<select>
<option value="Acessorio" class="campo">Tutto</option>
</select>
<select>
<option value="produto" class="campo">Iphone+4s</option>
</select>
</form>
<button type="button" id="send" class="btn">Buscar</button>
You want something like
http://www.rs1.com.br/tutto-moto/Acessorio/produto
that’s it?– mgibsonbr
That’s right, I didn’t leave in the exact order to bring the results but that’s the idea.
– Steve Angello