The function is taking the values of 2 inputs #modalidadeformacao and #modalidaderenovacao at the same time, I NEED it to only take the value of ONE or the OTHER.
Basically it would be:
IFsubmit the form with id #curso-de-formacao-formTHENget the value of vmformacao and NOT get the value of vmrenovacaoOR IFsubmit the form with id #curso-de-renovacao-formTHENget the value of vmrenovacao and NOT get the value of vmformacao
The forms and inputs are:
<script>function() {var vmformacao = document.querySelector('#curso-de-formacao-form #modalidadeformacao');var vmrenovacao = document.querySelector('#curso-de-renovacao-form #modalidaderenovacao');return (vmformacao ? vmformacao.value : '') +''+ (vmrenovacao ? vmrenovacao.value : '');}</script>
<div>Form 1</div><form action="" method="post" id="curso-de-formacao-form"><input type="text" name="modalidadeformacao" id="modalidadeformacao" value="Formação"><input id="formacaosubmit" type="submit" value="send"></form><div>Form 2</div><form action="" method="post" id="curso-de-renovacao-form"><input type="text" name="modalidaderenovacao" id="modalidaderenovacao" value="Renovação"><input id="formacaosubmit" type="submit" value="send"></form>