The path that generates the
action="undefined" value is this:
var value_1_2 = d3.select(this).property("market");
document.querySelector('#botao-de-jogo-betfair-1').action = value_1_2;
CSV file
"Lista_de_Jogos.csv" is:
label,value,market
,,
house,car,work
The selection box perfectly shows both attributes:
<option value="car" market="work">house</option>
But when I select this
, instead of
action of
#botao-de-jogo-betfair-1 keep the value
work he gets the value
undefined:
<form id="botao-de-jogo-betfair-1" action="undefined" target="_blank">
<input type="submit" style="width: 100%;" value="Jogo Betfair 1">
</form>
Note: when I try to use
.property("value") returns the value
car perfectly.
What I have tried:
<script src="https://d3js.org/d3.v4.js"></script>
<script id="script-da-caixa-de-selecao-suspensa-1">
var select_1 = d3.select("#caixa-suspensa-1")
.append("select")
.attr("id","select-box-1")
.style("width","100%");
function caixa_suspensa_1(data) {
select_1
.on("change", function(d) {
var value_1 = d3.select(this).property("value");
document.querySelector('#barra-de-texto-para-radar-1').value = value_1;
document.getElementById('botao-do-radar-1').click();
var value_1_2 = d3.select(this).property("market");
document.querySelector('#botao-de-jogo-betfair-1').action = value_1_2;
});
let update_1 = select_1.selectAll("option")
.data(data);
update_1.exit().remove();
update_1.enter().append("option").merge(update_1)
.attr("value", d => d.value)
.attr("market", d => d.market)
.text(d => d.label);
}
d3.csv("Lista_de_Jogos.csv", function(data){caixa_suspensa_1(data)});
</script>