Opa,
I think it should be simple, but I did not get a perfect run.
I have a function that when clicked should check the value contained in an input text, the values are separated by a /
and are integers. I need to remove it, if it is not, it should include it, I tried it like this:
var opcoes_selecionadas = document.getElementById("options_add_input").value;
if(opcoes_selecionadas.search("/"+opcao_id+"/")){
alert('string encontrada');
}
else
{
opcoes_selecionadas = opcoes_selecionadas + "/" + opcao_id;
document.getElementById("options_add_input").value = opcoes_selecionadas;
}
But, it's not working.