1
I have a page with several boxes containing some information and the price of the product, a URL and a select, when the person select a different option in select the price of the product will be changed. I searched the internet and found some examples that could work, however it worked only in a block.
For example on this server 01, it has this value of 30 and a URL, but when selecting the linux option this value change and also the URL.
.boxe{
float:left;
border: solid 1px #ccc;
margin:15px;
padding:15px;
min-width:135px;
text-align:center
}
.boxe .valor{
font-size:18px;
margin: 15px 0;
font-weight:700;
}
.boxe .url{
display:block;
margin-top:15px;
}
<div class="boxe">
<span class="nomePtoduto">
Servidor 01
</span>
<div class="valor" data-vl="30" data-vl-w="35">30</div>
<select>
<option>Linux</option>
<option>Windows</option>
</select>
<span class="url">
<a href="linux.html" data-url="linux.html" data-url-w="windows.html">Comprar</a>
</span>
</div>
<div class="boxe">
<span class="nomePtoduto">
Servidor 02
</span>
<div class="valor" data-vl="45" data-vl-w="50">45</div>
<select>
<option>Linux</option>
<option>Windows</option>
</select>
<span class="url">
<a href="linux.html" data-url="linux.html" data-url-w="windows.html">Comprar</a>
</span>
</div>
<div class="boxe">
<span class="nomePtoduto">
Servidor 03
</span>
<div class="valor" data-vl="50" data-vl-w="55">50</div>
<select>
<option>Linux</option>
<option>Windows</option>
</select>
<span class="url">
<a href="linux.html" data-url="linux.html" data-url-w="windows.html">Comprar</a>
</span>
</div>
Boy, who knows rsrs, man wouldn’t have a way to simplify that? because in what I will need there are many blocks, if to use a function for each block gets Trash, a form that it automatically identifies the boxing using only a function, has as it?
– Sérgio Machado
Yes, as soon as I have a little time I’ll update my response in the afternoon.
– AnthraxisBR
Blz man, really worth it
– Sérgio Machado
Hey, man, what’s up? Got an update?
– Sérgio Machado
Take a look, just see the attr 'data-box' that you will understand the mechanism
– AnthraxisBR
Thank you very much
– Sérgio Machado