3
I have a string variable called [Content] and I want to assign it the tag of a button that calls a javascript. I’m trying this way:
Conteudo = "<input id='btnOculta_" + lin + "' type='button' value='novo' class='btn btn-default' onclick='Ocultar(this, 'OcultaNovoMedicamento_1')' style='float:left' />"
But in the passage onclick='Hide(this, 'Occult'')' he is understanding the second ' as a closing of the first and not as a second opening. And returns me a whole wrong code.
Expected:
<input id="btnOculta_1" type="button" value="novo" class="btn btn-default" onclick="Ocultar(this, 'OcultaNovoMedicamento_1')" style="float:left" />
Obtained (wrong):
<input class="btn btn-default" id="btnOculta_1" style="float:left" onclick="Ocultar(this, " type="button" value="novo" ocultanovomedicamento_1')'="">
uHow I fix this cucumber?
Valew @Sergio your first hint using didn’t work... I don’t know how to test running here, rsrs. But the second one worked great! Thank you, you saved me here. In your example there is only one double quote left at the end, but ok.
– AlamBique
@Still fixed, so are the two examples without bugs :)
– Sergio