-2
I have two radiobuttons, which have the function of showing/hiding a input each, these two inputs cannot receive values together, only the input that is within the radiobutton selected, would like when selecting a radiobutton to erase the input from the other radiobutton, has some simple way to do this?
html code:
<input type="radio" name="formapag" value="debito" id="deb" onclick="document.getElementById('debito').style.display='inline';document.getElementById('credito').style.display='none';" />Venda
<input type="number" placeholder="R$0,00" min="0,01" step="0.01" name="debito" id="debito" placeholder="valor" style="display:none;">
<input type="radio" name="formapag" value="credito" id="cred" onclick="document.getElementById('debito').style.display='none';document.getElementById('credito').style.display='inline';" />Compra
<input type="number" placeholder="R$0,00" min="0,01" step="0.01" name="credito" id="credito" placeholder="valor" style="display:none;">
Those
radio
have the samename
? You can display the HTML?– Sergio