Below a solution to be worked, but before ... a little bubble, do not get too bad!
I am outraged that as much as you study, have the ability to create solutions, some biased does not give you the opportunity to act in the area.
I have been trying for over 13 years (I have not given up, however I look no further). For having in hand, crafts of the manual type,
many or all qualify you as incapable, without even having an idea of your competence.
I do not speak of the author of the question, but of those who get the thing ready. These are the ones that companies invest. In opportunists.
Here's an example of how to apply one of the solutions to the case!
PS: Sorry for the bad "professionalism" of the code.
Next ...
function CONFIRMA(txt, idform, confirmacao, ylegenda, nlegenda){
box = document.getElementById('bloco');
msg = document.getElementById('msg');
bt_y = document.getElementById('ylegenda');
bt_n = document.getElementById('nlegenda');
if(confirmacao==''&&txt!=0){
msg.innerHTML=txt;
bt_y.innerHTML=ylegenda;
bt_n.innerHTML=nlegenda;
box.style.display='block';
return false;
}
if(confirmacao == true){
document.getElementById(idform).submit();
}
box.style.display='none';
}
<div id="bloco" style="display: none;">
<div id="msg"></div>
<a href="javascript:void(0);" onClick="CONFIRMA(0, 'form1', true)"><span id="ylegenda"></span></a> -------------
<a href="javascript:void(0);" onClick="CONFIRMA(0, 'form1', false)"><span id="nlegenda"></span></a>
</div>
<div>
<p> </p>
<form id="form1" name="form1" method="post" onSubmit="return CONFIRMA('Vai fazer cagada?', this.id, false, 'Sim, sou imbecil', 'Puts...')" action="">
<input type="submit" name="Submit" value="Aplicar">
</form>
</div>
Just missing formatting with css styles.
Good luck!